Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.
Express provides a thin layer of fundamental web application features, without obscuring Node.js features. Build a REST API using ExpressJS to manage the movie details. The Node application should be able to read the data from a .json file as a REST resource.
Add new a movie, fetch all the movies, fetch a specific movie by id, delete a movie and update the details of a specific movie.
Note: The REST resource can be hosted on the local machine on a specific port,use the package json-server to perform the same.
Create an Express server to service requests from clients
Create a db.json file to hold the REST resource data
Run the db.json file as a server on a specified port
Define controller, routes and service layers
Define all http methods like GET, POST, PUT and DELETE
Define routes to
Get all the movies
Get a movie by movieId
Create a new movie and post the data
Update the details of a specific movie
Delete a movie by movieId. Test the output in the REST Client Postman.
Document the REST API using Swagger.
1.Download and unzip the boilerplate code.
2.Run the command npm install to install the dependencies.
3.Open the boilerplate code in VSCode to develop the assignment solution.
4.Write the logic in .js file present in src folder
5.Run the command npm i json-server to install JSON Server
5.Run the json-server -w data/movies.json
command
6.Run the test scripts available under src/test by giving the npm run test command in the terminal to test locally.
7.Refactor the solution to ensure all test cases are passing.
8.Test all REST end points on POSTMAN
9.Zip the solution code with the name same as the assignment name.
10.Upload the zipped solution for submission.
"# movie-application-with-express"