Skip to content
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

In-place replacement for bodyParser? #23

Open
danosaure opened this issue Jun 19, 2018 · 1 comment
Open

In-place replacement for bodyParser? #23

danosaure opened this issue Jun 19, 2018 · 1 comment

Comments

@danosaure
Copy link

danosaure commented Jun 19, 2018

I have a working app, and adding this and removing bodyParser makes it stop working.

Original:

const bodyParser = require('body-parser');
const express = require('express');
...
const app = express();
app.use(bodyParser.json());

Everything works as expected before the file upload... But if I remove body-parser, and just have:

const expressBusboy = require('express-busboy');
...
const app = express();
expressBusboy.extend(app, { upload: true });

then the rest of the app stop working, only the file upload works. But if I use both, then everything works as expected.

const app = express();
app.use(bodyParser.json());
expressBusboy.extend(app, { upload: true });

Am I misunderstanding the documentation?

express@4.16.3, body-parser@1.18.3, and express-busboy@7.0.0

Thanks,

@danosaure
Copy link
Author

Hi again,

In fact, now that I have both of them, I only have a single other POST, and it's not working anymore.

I had to convert my form to encType="multipart/form-data" for it to work again, but I am worried that this could impact other plugins.

Can you clarify if it is not compatible in my environment?

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant