Question: Create Node.js web server that listens port 3000 in the localhost. There is one route that waits request to /home/user end point and it takes

Create Node.js web server that listens port 3000 in the localhost. There is one route that waits request to /home/user end point and it takes two route parameters: name and age. When request arrives, the route parameters are extracted and following message is sent to the response if the age is greater or equals to 18. Welcome {name_param_value}, you're {age_param_value} years old Otherwise, the following message is sent to the response. Hello {name_param_value}, you're too young.

Create Node.js web server that listens port 3000 in the localhost. There

Create Node.js web server that listens port 3000 in the localhost. There is one route that waits request to /home/user end point and it takes two route parameters: name and age . When request arrives, the route parameters are extracted and following message is sent to the response if the age is greater or equals to 18. Welcome {name_param_value}, you're {age_param_value} years old Otherwise, the following message is sent to the response. Hello {name_param_value}, you're too young See the screenshots below. Age less than 18: localhost:3000/home/user/John/14 Hello John, you're too young Age greater than 18: f localhost:3000/home/user/John/20 Welcome John, you're 20 years old

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!