mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
* remove prefix from codeowners * remove references from ignore files * Remove prefix from package json and tests * Add run js without prefixes * Rename package folders * Delete auto generated test files * Remove now-node in integration test * Put back deleted vercel json files * Remove eol * Add styfle suggestion to comment in utils/run.js Co-authored-by: Steven <steven@ceriously.com>
20 lines
422 B
JavaScript
20 lines
422 B
JavaScript
const express = require('express');
|
|
|
|
const app = express();
|
|
|
|
module.exports = app;
|
|
|
|
app.use(express.json());
|
|
|
|
app.post('*', (req, res) => {
|
|
if (req.body == null) {
|
|
return res.status(400).send({ error: 'no JSON object in the request' });
|
|
}
|
|
|
|
return res.status(200).send(JSON.stringify(req.body, null, 4));
|
|
});
|
|
|
|
app.all('*', (req, res) => {
|
|
res.status(405).send({ error: 'only POST requests are accepted' });
|
|
});
|