Skip to content

Latest commit

 

History

History
61 lines (32 loc) · 1.33 KB

File metadata and controls

61 lines (32 loc) · 1.33 KB

Practical 12

  • Create a new directory with the name QuickFresh
    
    
  • Navigate inside the folder and open VS Code inside it
      
    
  • Now, create a index.js file inside this directory
  • Using the terminal initialize npm in this directory
    
    
  • Using npm install the ExpressJS module
    
    
  • Inside the index.js file perform the following:
  1. Import and initialize ExpressJS

  2. Set the Port to 9000

  3. Create a route "/", where the handler function returns the text Welcome to QuickFresh for a GET request

  4. Create a route "/about", where the handler function returns the html <h3>We are Vadodara's most trusted grocery delivery service></h3> for a GET request

  5. Create a route "/contact", where the handler function returns the JSON {"email":"[email protected]", "instagram": "http://instagram.com/quickfresh"} for a GET request

  6. Initiate the server to listen at the given port with a message Server running on http://localhost:9000 as an output when it is started

    
    
    
    
    
    
    
    
    
    
    
    
    
    

Bonus:

  • Sign up for Postman

  • Install the VS Code Extension

  • Login to your Account

  • Create a collection called QuickFresh

  • Test GET requests at all the three routes: "/", "/about", "/contact"

    Attach Screenshots for the same