Full-Stack Web Development with Vue.js and Node

(singke) #1
Building the Real Application Chapter 5

app.post('/movies', (req, res) => {
const newMovie = new MovieSchema({
name: req.body.name,
description: req.body.description,
release_year: req.body.release_year,
genre: req.body.genre,
});

newMovie.save((error, movie) => {
if (error) { console.log(error); }
res.send(movie);
});
});
};

Now, when we click the link on the title of the movie, we should be able to see the


following page:

Free download pdf