Author -  Sai gowtham

How to access the GET query parameters in Express

Learn, how to access the query parameters from a url in express.

Query parameters are passed at the end of a url using a question mark(?) followed by the key-value pairs.

Example:

localhost:3000/users?name=gowtham

In this url, the key is name and value is gowtham

Multiple query parameters can be passed by using a & (And operator).

localhost:3000/users?name=gowtham&id=1234

Accessing query parameters

To access the query parameters in an express route handler, we need to use req.query object.

const express = require('express');
const app = express();

app.get('/users', (req, res) => {
    const name = req.query.name;    const id = req.query.id;    res.send(`User is ${name}, id is ${id}`);
});

app.listen(3000, () => console.log(`App is running`));

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2023 (Beginner + Advanced)
JavaScript - The Complete Guide 2023 (Beginner + Advanced)
116,648 students enrolled
52 hours of video content
$14.99 FROM UDEMY
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
631,582 students enrolled
49 hours of video content
$24.99 FROM UDEMY
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
203,937 students enrolled
31.5 hours of video content
$14.99 FROM UDEMY