- create, read, update & delete.
express, mysql, nodemon & dotenv.
- Get users: "/users"
- Get user by id: "/users/:id"
- Add user: "/add"
- Delete user: "/delete/:id"
- Update user: "/update/:id"
You need to create the database and detail how the table will work before you start the server, so execute this in your mysql painel:
CREATE DATABASE db;
CREATE TABLE users (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, email VARCHAR(25), password VARCHAR(30));
Make sure to change your settings before running the server:
PORT=3000
HOST="localhost"
USER="root"
PASSWORD="root"
DATABASE="db"
Execute:
npm install
npm run start