We now have a movie listing page, we have an add movie page, so the next thing we have to do is save the data into the MongoDB when we submit the form.
Communicating with servers
Adding express to our application
Now that we have all the components in place, it's time to add the server layer to our application.
Let's start by adding the express package with the following:
npm install express --save
The next part is to create the necessary endpoints and models so that we can add the movies to the database.
To do that, we first need to install the required packages:
- body-parser: To parse the incoming requests
- cors: To handle cross-origin requests between frontend and backend
- morgan: HTTP request logger
- mongoose...