-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Express body-parser doesn't parse the body #25
Comments
Temporary workaround: using parsec |
After some magic happening, it now works: import { App } from '@tinyhttp/app'
import bodyParser from 'body-parser'
const app = new App()
app.use(bodyParser.urlencoded({ extended: false }))
app.use((req, res, next) => {
console.log(req.body)
next()
})
app.get('/', (req, res) => void res.send(req.body))
app.listen(3000) |
Hi, i tried to use body parser with tinyhttp (using typescript) but it doesnt seem to work due to types |
@spideythewebhead please provide a reproduction sample |
ok, a 'workaround' is to cast as
Sorry, for the inconvenience. |
@spideythewebhead that's not a good solution could you pls provide your tinyhttp version? I thought that type error got fixed before |
@talentlessguy yeah i know but its not a great deal.
|
Ok I am not sure what exactly happened, I did try it on a new project and it works without the casting |
Hi! I've run into this, and it seems to still be happening. |
@iamricard Cannot reproduce this, |
Describe the bug
With using Express
body-parser
, neitherbodyParser.json
norbodyParser.urlencoded
work. Instead of a body will with data we get{}
To Reproduce
Steps to reproduce the behavior:
and then in terminal:
curl localhost:3000 -X POST -F "a=b"
Expected behavior
req.body
would be filled with dataVersions
node
: 14.5.0@tinyhttp
: 0.2.12Additional context
body-parser repo
The text was updated successfully, but these errors were encountered: