Skip to main content

Exercise 13

  • Create the following folder/file structure:
/ex_13
|-- index.js
|-- user.js
|-- home.js

home.js

  • Create a route handler
  • This router will handle the GET HTTP method
  • The response will send the following message:
This is my Home page using Express Router

user.js

  • Create a route handler
  • This router will handle the following HTTP methods and responde the corresponding texts
    • GET: Please log to get a user
    • POST: Please log to create a user
    • PUT: Please log to update a user
    • DELETE: Please log to delete a user

index.js

  • Create a Express web server using port 3000
  • Mount the home router on '/'
  • Mount the user router on '/users'

Once you have the code ready

  • Test the home router using the browser
  • Test the users router using Postman