What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-02 04:45:06
req.params.id in nodejs
req.params contains route parameters (in the path portion of the URL), and req.query contains the URL query parameters (after the ? in the URL). You can also use req.param(name) to look up a parameter in both places (as well as req.body), but this method... Add solution -
Javascript 2022-01-22 21:16:03
expressjs query params
app.get('/path/:name', function(req, res) { // url: /path/test console.log(req.params.name); // result: test }); // OR app.get('/path', function(req, res) { // url: /path?name='test' console.log(req.query['name']); // result: test }); Add solution -
Javascript 2021-11-09 17:32:08
filter a query string with comparison operator
//if need to find ratings greater then 3 //The query string may be: //127.0.0.1:8000/api/v1/posts?ratings[gt]=3 //if we check the req.query //{ ratings: { gt: '3' } } exports.getPosts = async (req, res) => { try { const queryObj = { ...req.query ... Add solution -
Other 2021-11-03 06:16:10
dynamically create azure functions
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}?api-version=2016-08-01 Authorization: Bearer <Your Token> Content-type: application/json... Add solution -
Javascript 2021-10-28 07:27:13
Set up google OAuth2 Login with Express
/// STEP 2. make main.ejs // include get route, get some data callback, get some data const express = require('express'); const google = require('googleapis').google; const jwt = require('jsonwebtoken'); // Google's OAuth2 client const OAuth2 = google.a... Add solution