Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 oldStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started