npm install
- start mysql server
npm start
... to start nodemon- http://localhost:8000/
- Seeing Database:
npm run roles:seed
npm install -g nodemon
npm install -g ts-node
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
ke
- NO npm start, just
F5
OR ctrl + shift + p
-> Debug: Toggle Auto Attach Always +npm start
npm init -y
npm i -D typescript ts-node nodemon
and TS globalnpm i -g typescript
tsc --init
- create
nodemon.json
and add stuff
- Delete all rows and ignore Foreign Keys
PRAGMA foreign_keys = OFF; DELETE FROM table_name; PRAGMA foreign_keys = ON;
- Delete all rows and ignore Foreign Keys
SET FOREIGN_KEY_CHECKS = 0; truncate table table_name; SET FOREIGN_KEY_CHECKS = 1;
- REST API framework
npm i express cors
- Install respective types
npm i -D @types/express @types/cors
- Encryption package
npm i bcryptjs
npm i -D @types/bcrypt
- https://typeorm.io/#/
- Repository and ORM package
- https://www.sqlitetutorial.net/sqlite-nodejs/connect/
npm install sqlite3 --save
- validation library
- json web token packages
npm i jsonwebtoken
npm i -D @types/jsonwebtoken
- Steps:
- define payload & create token respectively
- store token in http-only-cookie
npm i cookie-parser
... to receive cookie from api-responsenpm i -D @types/cookie-parser
npm i dotenv
- https://www.npmjs.com/package/dotenv
- DONT KEEP .env file in repo !!!
- create respective .env file on each machine:
SECRET_KEY="..."
npm i multer
npm i -D @types/multer
npm i json2csv
npm i -D @types/json2csv