mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
tests
This commit is contained in:
parent
db463db6ff
commit
9de4486dbe
22
body-parser/body-parser-tests.ts
Normal file
22
body-parser/body-parser-tests.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import * as express from 'express';
|
||||
import {
|
||||
json,
|
||||
raw,
|
||||
text,
|
||||
urlencoded,
|
||||
} from 'body-parser';
|
||||
|
||||
const app = express();
|
||||
|
||||
express.use(json());
|
||||
express.use(raw());
|
||||
express.use(text());
|
||||
express.use(urlencoded());
|
||||
|
||||
// send any data, it should be parsed and printed
|
||||
express.all('/', (req, res, next) => {
|
||||
console.log(req.body);
|
||||
res.json(req.body);
|
||||
});
|
||||
|
||||
express.listen(8080);
|
||||
@ -2,7 +2,8 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
@ -16,6 +17,7 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"body-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user