jchuerva / devflix_learn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

devflix

A platform to recap all video content

devflix-api

Videos CRUD

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

Steps

  1. git init
  2. npm init
  3. .gitignore from gitignore.io
  4. Use express for the REST: npm i express
  5. Create README
  6. Create LICENSE from MIT LICENSE
  7. Install linters: npm i -D eslint eslint-config-prettier eslint-plugin-prettier prettier// development
  8. Install nodemon npm i -D nodemon for auto reload the server
  9. Create .eslintrc and .prettierrc
  10. Create index.js
  11. Add scripts in package.json
"scripts": {
  "dev": "nodemon index.js",
  "start": "NODE_ENV=production node index.js"
}
  1. Add library husky to prevent bad commits : npm i -D husky. Configure it in package.json
  2. Add config folder and index.js for App configuration
  3. Add npm i -D dotenv and configure the .env file and config ☝️ file
  4. Create routes in routes folder
  5. Create services folder, where we add the functions that will call the DB
  6. Create lib/db.js to connect it to the DB

About

License:MIT License


Languages

Language:JavaScript 100.0%