app.use(bodyParser.json()); app.use( bodyParser.urlencoded({ extended: true })
app.use(bodyParser.urlencoded({ extended: true, limit: LIMIT_SIZE})); app.use(bodyParser.json()); app.use('/cgi-bin/sessions/export', function(req, res) {
app.use(bodyParser.json()); app.use( bodyParser.urlencoded({ extended: true })
}); }); api.use('/', bodyParser.urlencoded({ extended: false }), new _PublicAPIRouter.PublicAPIRouter().expressRouter());
bodyParser() { const { app } = this app.use(bodyParser.urlencoded({ extended: false })) app.use(bodyParser.json()) }
it('should be able to PUT form data', runMockTest({ cmd: './cli.js add http://localhost:9199/data --data "parameter=something" --method=put', method: 'put', middleware: bodyParser.urlencoded({extended: true}), port: 9199, test: (req, res) => { assert.strictEqual(req.body.parameter, 'something'); res.sendStatus(200); } }));
connect() .use(bodyParser.urlencoded({ extended: false })) .use((req, res, next) => { res.setHeader('Content-Type', 'text/plain'); res.end('You sent: ' + JSON.stringify(req.body) + '\n'); }) .listen(3000);
middleware() { this.app.use(cors()); this.app.use(morgan('dev')); this.app.use(bodyParser.json()); this.app.use(bodyParser.urlencoded({ extended: true })); }
function SetupLoggingParsingPublic() { if (process.env.NODE_ENV !== 'test') { app.use(logger('dev')); } app.use(bodyParser.urlencoded({ extended: true })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); }
async function createServer () { try { const app = await ruo.createApplicationAsync() app.use(bodyParser.urlencoded({extended: true})) app.use(bodyParser.json()) app.use(ruo.restMiddleware()) return app } catch (err) { console.log(err.stack); // eslint-disable-line process.exit(1) } }
it('should be able to send from data file', runMockTest({ cmd: './cli.js add http://localhost:9201/data --data ./fixtures/data', method: 'post', middleware: bodyParser.urlencoded({extended: true}), port: 9201, test: (req, res) => { assert.strictEqual(req.body.dolor.trim(), 'sit'); res.sendStatus(200); } }));
async init({ express }) { express.use(bodyParser.json()); express.use(bodyParser.urlencoded({ extended: true })); express.use(cookieParser()); express.use(this.extractToken.bind(this)); }
/** * Creates a barebone express app with basic setup. */ function _initialize_() { let app = express(); app.use(cors()); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); return app; }
it('should be able to POST form data', runMockTest({ cmd: './cli.js add http://localhost:9198/data --data "parameter=value&also=another" --verbose', method: 'post', middleware: bodyParser.urlencoded({extended: true}), port: 9198, test: (req, res) => { assert.strictEqual(req.body.parameter, 'value'); assert.strictEqual(req.body.also, 'another'); res.sendStatus(200); } }));
function expressInitialization () { // uncomment after placing your favicon in /public // app.use(favicon(path.join(__dirname, "public", "favicon.ico"))); app.use(logger("dev")); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: false})); app.use(cookieParser()); }