What do you want to save?
Add Code snippet
New code examples
-
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-08 15:16:07
expressjs server
/* ====== create node.js server with express.js framework ====== */ // dependencies const express = require("express"); const app = express(); app.get("/", (req, res) => { res.send("This is home page."); }); app.post... Add solution -
Javascript 2021-10-06 14:30:07
get parameter from url server side node js
const express = require("express"); //create express app const app = express(); //port at which the server will run const port = 4000; //create end point app.get("/", (request, response) => { //send 'Hi, from Node server' to clien... Add solution -
Javascript 2021-10-05 13:16:02
express import
// app.js import express from 'express'; import path from 'path'; import cookieParser from 'cookie-parser'; import logger from 'morgan'; import indexRouter from './routes/index'; import usersRouter from './routes/users'; var app = express(); app.use(logge... Add solution -
Javascript 2021-10-05 11:21:07
express get raw path
const url = require('url'); const express = require('express'); const app = express(); app.use((req, res, next) => { const path = url.parse(req.url).path; // Do something... }); const port = 3000; app.listen(port, console.log(`Listening on port $... Add solution -
C++ 2021-10-04 07:38:06
react cookie
// server.jsrequire('@babel/register'); const express = require('express');const serverMiddleware = require('./src/server').default;const cookiesMiddleware = require('universal-cookie-express'); ... Add solution -
Javascript 2021-10-04 04:23:04
jwt implementation in node js
// index.js const express = require('express'); const jwt = require('jsonwebtoken'); const app = express(); // generate token for another API to use in req.header app.post('/login', (req, res) => { const user = { id: 1, username... Add solution