Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed REST APIs with Express!
You have completed REST APIs with Express!
Preview
In this video we'll create an Express POST route allowing the client to create a new quote and save it to the datastore.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
let's write a new post route
to handle request to /quotes.
0:00
Notice that this looks exactly
like the first route we wrote,
0:09
only we're using the post method instead.
0:13
When a get request is sent to the quotes
route, this code up here will run.
0:16
But when a post request is
sent to the same route,
0:21
whatever we write inside
this callback will be run.
0:24
Inside the post route callback,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up