Express API Mongoose + MongoDB

COMANDOS BÁSICOS


image

npm init
npm install
npm update
npm run dev
npm run start

npm install express mongoose 

cadena de conexión mongoDB: mongodb://localhost:27017/ejemplo_db

#### Mongo DB server
show dbs
use netflix_db
db.createCollection('movies')
db.createCollection('categories')

#### END-POINTS ---------------------------------------------------------------
#### Home
GET - localhost:3000

#### Movies
GET - localhost:3000/movie
GET - localhost:3000/movie/:id
GET - localhost:3000/movie/available
POST - localhost:3000/movie
PUT - localhost:3000/movie/:id
DELETE - localhost:3000/movie
DELETE - localhost:3000/movie/:id

#### Categories
GET - localhost:3000/categorie
GET - localhost:3000/categorie/:id
POST - localhost:3000/categorie
PUT - localhost:3000/categorie/:id
DELETE - localhost:3000/categorie
DELETE - localhost:3000/categorie/id