03 - Postman set up
In this module, we'll start to use Postman to test our application.
Adding a Response
Let's use Postman to start testing our server by following these steps. Please know that a little bit of the code will be explained in future modules. Right now, we just want to get used to using Postman:
Go into the directory with
app.jsand enter thenodemon app.jscommand to start the server. Leave it running.Let's go into the
app.jsfile. Add the code below to the bottom of the file:app.use('/api/test', function(req, res){ res.send("This is data from the /api/test endpoint. It's from the server."); });Again, we'll talk about the code soon. Keep the server running for now.
Open up Postman.
Choose
File->New->Request.In the request view, choose
GETfrom the dropdown.Enter the following url in the url input field:
http://localhost:3000/api/testClick send.
You should see the following result in the Postman response window:
Last updated