Skip to content

Latest commit

Β 

History

History
38 lines (20 loc) Β· 1000 Bytes

File metadata and controls

38 lines (20 loc) Β· 1000 Bytes

I built an Api-Rest with NodeJs & Mysql, but i am going to use traditional QUERYS to get data from endpoint not using ORM!!!

πŸš§πŸš§πŸš§πŸ—οΈπŸ—οΈπŸ—οΈπŸš§πŸš§πŸš§

To start clone repository & npm i to install all dependencies !

Used:

npm install --save mysql

To start Api:

npm run start

Let’s start off by installing a the nodemon package. This is a tool that automatically restarts a Node application when file changes in a directory are detected:

npm install --save-dev nodemon

USE EXPRESS TO HAVE SERVER

npm install --save express

To run app with nodemoon

npm run dev

Bd is deployed in Clever cloud πŸ˜Άβ€πŸŒ«οΈ

Installed & used dotenv to have .env... https://www.npmjs.com/package/dotenv

WE HAVE TWO WAYS to play with querys πŸ—οΈ

One => create a const with query Two => create the query into the function πŸ“ŒAlso we can create the constant to call it after query. For tha y use ? ternary is a well practiceπŸ“Œ