Go to file
dependabot[bot] a4d6cefe31
Bump json5 from 2.1.3 to 2.2.3
Bumps [json5](https://github.com/json5/json5) from 2.1.3 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.1.3...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 06:46:29 +00:00
.vscode Initial commit. 2020-04-30 14:53:27 +02:00
public Initial commit. 2020-04-30 14:53:27 +02:00
src Initial commit. 2020-04-30 14:53:27 +02:00
.dockerignore Initial commit. 2020-04-30 14:53:27 +02:00
.eslintignore Initial commit. 2020-04-30 14:53:27 +02:00
.eslintrc.js Initial commit. 2020-04-30 14:53:27 +02:00
.gitignore Initial commit. 2020-04-30 14:53:27 +02:00
.mocharc.json Initial commit. 2020-04-30 14:53:27 +02:00
.npmrc Initial commit. 2020-04-30 14:53:27 +02:00
.prettierignore Initial commit. 2020-04-30 14:53:27 +02:00
.prettierrc Initial commit. 2020-04-30 14:53:27 +02:00
.yo-rc.json Initial commit. 2020-04-30 14:53:27 +02:00
DEVELOPING.md Initial commit. 2020-04-30 14:53:27 +02:00
docker-compose.yml Initial commit. 2020-04-30 14:53:27 +02:00
Dockerfile Initial commit. 2020-04-30 14:53:27 +02:00
index.js Initial commit. 2020-04-30 14:53:27 +02:00
index.ts Initial commit. 2020-04-30 14:53:27 +02:00
package-lock.json Bump json5 from 2.1.3 to 2.2.3 2023-01-06 06:46:29 +00:00
package.json Initial commit. 2020-04-30 14:53:27 +02:00
README.md Initial commit. 2020-04-30 14:53:27 +02:00
tsconfig.json Initial commit. 2020-04-30 14:53:27 +02:00

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/ LoopBack