Answers for "node express json on query"

2

node.js express post query string

const express = require('express');
const bodyParser = require('body-parser');

const app = express();
app.use(bodyParser.urlencoded({ extended: true }));

// POST /somepost/?name=somename
app.post('/somepost', (req, res) => {
    console.log('Name:', req.query.name);
    res.status(200);
});
Posted by: Guest on June-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language