Changez votre datasource.json en :
{
"db": {
"host": "localhost",
"port": 3306,
"url": "",
"database": "shoppingdatabase",
"password": "",
"name": "db",
"user": "root",
"connector": "mysql",
"connectTimeout":9000000
}
}
et model.json comme
{
"_meta": {
"sources": [
"loopback/common/models",
"loopback/server/models",
"../common/models",
"./models"
],
"mixins": [
"loopback/common/mixins",
"loopback/server/mixins",
"../common/mixins",
"./mixins"
]
},
"User": {
"dataSource": "db"
},
"AccessToken": {
"dataSource": "db",
"public": false
},
"ACL": {
"dataSource": "db",
"public": false
},
"RoleMapping": {
"dataSource": "db",
"public": false,
"options": {
"strictObjectIDCoercion": true
}
},
"Role": {
"dataSource": "db",
"public": false
},
"carts": {
"dataSource": "db",
"public": true
},
"products": {
"dataSource": "db",
"public": true
},
"users": {
"dataSource": "db",
"public": true
},
"vendors": {
"dataSource": "db",
"public": true
}
}
et avant cela, créez manuellement une base de données dans MySQL avec le nom "shoppingdatabase" car le bouclage aura besoin de la base de données pré-créée. Et gardez-la également protégée par un mot de passe.