Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a web server that Accepts and processes request messages submitted from browser, and Generates and sends response messages back to browser for display. Your

Create a web server that

  1. Accepts and processes request messages submitted from browser, and
  2. Generates and sends response messages back to browser for display.

Your web server must be able to handle

  1. URL with hostname and port
    1. Request message URL: 127.0.0.1:3000
    2. Response message: SUCCESS!
  2. URL with hostname, port and path
    1. Request message URL: 127.0.0.1:3000/alpha
    2. Response message: SUCCESS! alpha
  3. URL with hostname, port, path and query string
    1. Request message URL: 127.0.0.1:3000/bravo?name=charlie
    2. Response message: SUCCESS! bravo charlie
  4. Invalid/unexpected URL
    1. Request message URL: 127.0.0.1:3000/mumbojumbo
    2. Response message: FAILED! Fix your URL.

Hostname 127.0.0.1 can be replaced by localhost.

Port number 3000 can be replaced by any other port number that is from 1024 (2^11) to 65535 (2^17 1) inclusive.

Tools - Use the following:

  1. Node.js
  2. Express.js
  3. Express.js router endpoint path
  4. Express.js req.query
  5. GET request

Checklist

Do the following:

  1. Create a folder that is dedicated to this lab exercise
  2. Create a Node.js server file
    1. Insert necessary endpoints
    2. Listen to selected port
  3. Create a package.json file with npm init
  4. Install necessary npm module(s)
  5. Test the code locally by
    1. Executing the Node.js server file
    2. Enter and submit various URLs in browser

ASSUME ALL MODULES HAS BEEN INSTALLED THROUGH NMP, NEED THE CODE ALONE. THANKS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

=+ Are unions company-wide, regional, or national?

Answered: 1 week ago