7198b1861f
Bumps [qs](https://github.com/ljharb/qs), [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. Updates `qs` from 6.9.3 to 6.11.0 - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.9.3...v6.11.0) Updates `body-parser` from 1.19.0 to 1.20.1 - [Release notes](https://github.com/expressjs/body-parser/releases) - [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/body-parser/compare/1.19.0...1.20.1) Updates `express` from 4.17.1 to 4.18.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2) --- updated-dependencies: - dependency-name: qs dependency-type: indirect - dependency-name: body-parser dependency-type: indirect - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.vscode | ||
public | ||
src | ||
.dockerignore | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.mocharc.json | ||
.npmrc | ||
.prettierignore | ||
.prettierrc | ||
.yo-rc.json | ||
DEVELOPING.md | ||
docker-compose.yml | ||
Dockerfile | ||
index.js | ||
index.ts | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json |
stock-recording
Abandonné, car documentation de faible qualité et authentification moins simple que dans loopback3 et flask-restx.
Dev
yohan@y1:~$ sudo apt-get -y install npm nodejs
yohan@y1:~$ mkdir ~/.npm-global
yohan@y1:~$ npm config set prefix '~/.npm-global'
yohan@y1:~$ echo "PATH=~/.npm-global/bin:$PATH" >> ~/.profile
yohan@y1:~$ npm install -g @loopback/cli
yohan@y1:~$ lb4 app
yohan@y1:~$ cd stock-recording
yohan@y1:~/stock-recording$ lb4 model
yohan@y1:~/stock-recording$ lb4 datasource
yohan@y1:~/stock-recording$ lb4 repository
yohan@y1:~/stock-recording$ lb4 controller
yohan@y1:~/stock-recording$ npm install --save @loopback/authentication
Deploy
yohan@y1:~/stock-recording$ rsync -itrlpgovDHzP --delete-after ./ ovh1:/home/yohan/repository/stock-recording/
Setup
[yohan@ovh1 repository]$ cd stock-recording
[yohan@ovh1 stock-recording]$ sudo docker exec -it mysql-server bash
root@42ebf0d5ad35:/# mysql -u root -p
MariaDB [(none)]> CREATE USER 'stock-recording'@'%' IDENTIFIED BY 'FIXME';
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS stock_recording;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON stock_recording.* TO 'stock-recording'@'%' IDENTIFIED BY 'FIXME';
MariaDB [(none)]> quit
root@42ebf0d5ad35:/# exit
Run
[yohan@ovh1 stock-recording]$ sudo docker-compose up -d --build
[yohan@ovh1 stock-recording]$ sudo docker exec stock-recording npm run migrate
Références
https://medium.com/@iqbaldjulfri/role-based-authentication-with-jwt-in-loopback-4-4f9ab63daa52 https://www.freecodecamp.org/news/build-restful-api-with-authentication-under-5-minutes-using-loopback-by-expressjs-no-programming-31231b8472ca/