Backend built with Node.js/Express and MongoDB, with pre-defined authentication, email verification, and account deletion.
this server is deployed on heroku https://movies-api-server11.herokuapp.com/
- Mongodb (local and cloud)
- Email Verification
- user details and password stored into environment variables
- Password reset and delete account
- Manage user Authentication using Json Web Token
- CRUD operations for the movies api
- CRUD operations for the genres api
- GET /api/genres result ex:
[{ name: "action", desc: "full of action"}, {name:"comedy", dec: "xyzz.."}]
- POST /api/genres add genres to database ex:
{name: "drama", desc: "drama stuff"}
- GET/ POST /api/movies movies added to database ex:
{"title": "name of movie", "genreId": "genre id", "numberInStock": 12, "dailyRentalRate" : 1.2}
- PUT /api/movies/"type movie id" update movie to database ex:
{"title": "name of movie", "genreId": "genre id", "numberInStock": 12, "dailyRentalRate" : 1.2}
- DELETE /api/movies/"movie id" delete a movie from the database
- POST /api/users add a user account to login ex:
{name: "sarb", email: "sarb@gmail.com", password: "123dhjshk"}
- POST /api/login login to account ex:
{email:"sarb@gmail.com", password: "ahdjkhkjadh"}
- A jwt token will be sent in the header if the user successfully logs in.
- install config npm i config
- create config folder with "default.json" and "custom-environment-variables.json" files
- defined required enviroment variables in "default.json" and "custom-enviroment-variables files"
- set custom environment variables on local machine server by typing ex: $
export variablename="variablevalue"
- For example if user want to set remote_db, just go to command prompt type :
export remote_db="remote db address type here"
- set custom environment variables on remote server(heroku) by typing ex: $
heroku config:set variablename="variablevalue"
- display saved custom variables on remote server by typing ex: $
heroku config
- display saved custom variables on local server by typing ex: $
export