Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

express get params after ?

GET /something?color1=red&color2=blue

app.get('/something', (req, res) => {
    req.query.color1 === 'red'  // true
    req.query.color2 === 'blue' // true
})

req.params refers to items with a ':' in the URL and req.query refers to items associated with the '?
Comment

How to access the GET parameters after “?” in Express

GET /something?color1=red&color2=blue

app.get('/something', (req, res) => {
    req.query.color1 === 'red'  // true
    req.query.color2 === 'blue' // true
})

req.params refers to items with a ':' in the URL and req.query refers to items associated with the '?
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript html append 
Javascript :: string to number 
Javascript :: how to remove more than one attribute using jquery 
Javascript :: discord chatbot 
Javascript :: javascript convert string with square brackets to array 
Javascript :: object flatten js 
Javascript :: counter app in react class based component 
Javascript :: how to return a factorial in javascript 
Javascript :: sfc in react 
Javascript :: vanilla javascript change background color 
Javascript :: str replace javascript all 
Javascript :: babylon js camera position 
Javascript :: build url query string javascript 
Javascript :: Material-ui add comment icon 
Javascript :: using async function in useeffect 
Javascript :: electron new window 
Javascript :: jshint ignore 
Javascript :: ISS proxy express 
Javascript :: javascript escape regex 
Javascript :: modulo operator in javascript 
Javascript :: using fetch api 
Javascript :: nuxt eslint prettier vetur 
Javascript :: remove duplicates multidimensional array javascript 
Javascript :: momentjs german date format 
Javascript :: react 18 render 
Javascript :: how to check if the first letter of a string is capitalized or uppercase in js 
Javascript :: html2canvas reduce image size 
Javascript :: antd react native 
Javascript :: initialize function in javascript 
Javascript :: debounce javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =