What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-14 01:49:03
express.js GET params
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 associat... Add solution -
Javascript 2021-10-13 04:52:04
express minify html
var express = require('express'); var minifyHTML = require('express-minify-html'); var app = express(); app.use(minifyHTML({ override: true, except... Add solution -
Javascript 2021-10-12 08:18:14
import { Application } from "express"
import { Request, Response, Application } from 'express'; import express = require('express'); var app: Application = express(); app.get('/', function (req: Request, res: Response) { res.send('Hello World') }); app.listen(3000); Add solution -
Javascript 2021-10-05 05:16:04
fetch data from external url nodejs
const fetch = require('node-fetch'); app.get('/', function (req, res) { var url = 'https://api.darksky.net/forecast/<API KEY>/37.8267,-122.4233'; fetch(url) .then(res => res.json()) .then(data => { res.send({ ... Add solution