- create .env file with
SECRET_KEYin root directory - create ormconfig.json file with db connection details (including db password) in root directory
npm install- (start mysql server) --> changed to sqlite
npm start... to start nodemon- http://localhost:8000/
- Seeing Database:
npm run roles:seed
npm install -g nodemonnpm install -g ts-nodeSet-ExecutionPolicy RemoteSigned -Scope CurrentUserke
- NO npm start, just
F5(usingLaunch via NPMlaunch.json configuration) OR ctrl + shift + p-> Debug: Toggle Auto Attach Always +npm start
npm init -ynpm i -D typescript ts-node nodemonand TS globalnpm i -g typescripttsc --init
- create
nodemon.jsonand add stuff
- REST API framework
npm i express cors- Install respective types
npm i -D @types/express @types/cors
- Encryption package
npm i bcryptjsnpm 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 jsonwebtokennpm 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 multernpm i -D @types/multer
npm i json2csvnpm i -D @types/json2csv
- try redner.com
- 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;