What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-29 13:01:03
expressjs swagger yaml
// To load your swagger specification yaml file you need to use a module able to convert // yaml to json; for instance yamljs. >> npm install --save yamljs const express = require('express'); const app = express(); const swaggerUi = require('swag... Add solution -
Javascript 2021-09-29 08:39:03
express js 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-09-24 23:59:02
how to create server in node js using express
/* ====== 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-09-23 01:45:03
create server and connect to db and frontend
// create directory //npm init -y //npm i express --save //npm i mysql --save //create public directory //create server.js // <---- In the server js file ---> 'use strict'; const express = require('express'); const app = express(); app.use(expre... Add solution -
Javascript 2021-09-21 06:11:02
node app create
#1. server.js var express = require('express'); var app = express(); app.get('/', function (req, res) { res.status(200).send('Hello World!'); }); var port = process.env.PORT || 3000; var server = app.listen(port, function() { console.log('Express s... Add solution -
Javascript 2021-09-21 06:10:02
express server replit
const express = require('express'); const bodyParser = require('body-parser'); const app = express(); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(express.static('public')); app.get('/', (req, res) => { r... Add solution -
Javascript 2021-09-20 01:38:02
reverse proxy using expressjs
var express = require('express'); var app = express(); var httpProxy = require('http-proxy'); var apiProxy = httpProxy.createProxyServer(); var serverOne = 'http://localhost:3001', ServerTwo = 'http://localhost:3002', ServerThree = 'http://l... Add solution -
Javascript 2021-09-19 00:18:02
express get
/* ====== 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-09-18 19:11:06
difference between express() and express.router()
var express = require('express'), dogs = require('./routes/dogs'), cats = require('./routes/cats'), birds = require('./routes/birds'); var app = express(); app.use('/dogs', dogs); app.use('/cats', cats); app.use('/birds', birds); ... Add solution