How can I make my server to take the NAME and AGE of the user in Node?


Do you have any ideas how can I make my server to take the NAME of the user from a request URL and user’s AGE from URL query string in Node?

After pressing continue the server should say ‘Hi + name of user’ and also decide if he’s under age to continue or not. Thanks for any help.

Here’s my JS:

var express = require(“express”);

//use the application off of express.
var app = express();

//define the route for “/”
app.get("/", function (request, response){


console.log(“Server listening on http://localhost:3000”);

And my HTML:

Simple hello world .prompt { font-size: 16px; color: brown; font-weight: bold; margin-bottom: 5px; } .container { width: 50%; } .left-pane { width: 50%; float: left; } .right-pane { width: 50%; float: right; } .submit-name { clear: both; }

Hello Node JS

<form method='GET' action="/getemail">
    <div class="container">
        <div class="prompt left-pane">
            <span>Give us your firstname and get email address</span>
        <div class="right-pane">
            <input type="text" id="firstname" name="firstname" />
    <div class="submit-name">
        <input type="submit" value="get the email" />

Googling “node query parameters” turns up a very solid first hit: How to access query string parameters | Node.js

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.