What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-02 04:04:02
multer()
// Installation // npm install --save multer // Usage var express = require('express') var multer = require('multer') var upload = multer({ dest: 'uploads/' }) var app = express() app.post('/profile', upload.single('avatar'), function (req, res, nex... Add solution -
TypeScript 2021-10-01 17:17:02
jwt refresh token
/** @description for module commonjs */ // JWT MIDDLEWARE const jwt = require('jsonwebtoken') const { message } = require('../utils/util.message') module.exports = (req, res, next) => { try { const tokenHeader = req.headers.authorization.split... 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-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-17 15:24:03
app use body parser
var express = require('express') var app = express() app.use(express.json()) // for parsing application/json app.use(express.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded app.post('/profile', function (req, res, next)... Add solution -
Javascript 2021-09-16 02:42:01
example formidable multiple image upload
app.post('/upload',function(req,res){ var form = new formidable.IncomingForm(), files = [], fields = []; form.on('field', function(field, value) { console.log("field"); fields.push([field, value]); }); for... Add solution -
TypeScript 2021-09-15 15:00:03
delete attachments in nodejs
// NOTE: `file_name` values are obfuscated and uniquely generated by the client. // The actual file name is in data storage. app.post('/delete/:file_name', (req, res) => { const theFile = 'attachments/' + req.params.file_name; var resultHandle... Add solution
Best helpers
Ranking is empty