A platform to recap all video content
Endpoint | HTTP | Description |
---|---|---|
/videos |
GET | Retrieve all the videos |
/videos/:id |
GET | Retrieve an specific video with id |
/videos |
POST | Create a new video |
/videos/:id |
PUT | Update a existing video |
/videos/:id |
DELETE | Remove a video |
git init
npm init
.gitignore
from gitignore.io- Use
express
for the REST:npm i express
- Create README
- Create LICENSE from MIT LICENSE
- Install linters:
npm i -D eslint eslint-config-prettier eslint-plugin-prettier prettier// development
- Install nodemon
npm i -D nodemon
for auto reload the server - Create
.eslintrc
and.prettierrc
- Create
index.js
- Add scripts in
package.json
"scripts": {
"dev": "nodemon index.js",
"start": "NODE_ENV=production node index.js"
}
- Add library
husky
to prevent bad commits :npm i -D husky
. Configure it inpackage.json
- Add config folder and
index.js
for App configuration - Add
npm i -D dotenv
and configure the.env
file and config ☝️ file - Create routes in
routes
folder - Create
services
folder, where we add the functions that will call the DB - Create
lib/db.js
to connect it to the DB