What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-27 09:26:09
connect react with database server
const express = require('express'); const bodyParser = require('body-parser'); var connection = require('express-myconnection'); var mysql = require('mysql'); const app = express(); app.use(bodyParser.json()); app.use( connection(mysql,{ ... Add solution -
Other 2021-10-19 04:37:04
passport-google-oauth2 cookies
// Required dependencies const express = require('express'); const app = express(); const passport = require('passport'); const GoogleStrategy = require('passport-google-oauth20'); const cookieSession = require('cookie-session'); // cookieSession config... Add solution -
Javascript 2021-10-16 15:23:10
How to Upload Files to a Node.js Server
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=KP_8gN8kh4Y */ // Import dependencies const fs = require("fs"); const YAML = require("js-yaml"); const express = requi... Add solution -
Javascript 2021-10-14 11:16:10
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-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 23:51:07
parse json express
// Update for Express 4.16+ // Starting with release 4.16.0, a new express.json() middleware is available. var express = require('express'); var app = express(); app.use(express.json()); app.post('/', function(request, response){ console.log(request.b... Add solution -
Javascript 2021-10-12 12:43:04
How to parse POST requests with express nodejs
const express = require('express'); const bodyParser = require('body-parser'); const app = express(); app.use(bodyParser.urlencoded({ extended: true })); app.post('/post-test', (req, res) => { console.log('Got body:', req.body); res.sendStatu... Add solution