openfaas-incubator / node8-express-template

Node.js 8 template for OpenFaaS with HTTP via Express.js
MIT License
15 stars 18 forks source link

How to write the post request by using this template #3

Closed badkk closed 6 years ago

badkk commented 6 years ago

I'm writing the post function, I just use the

    app.post('/upload', function (req, res) {});

but it did not work. Anybody knows the right way to write post code?

alexellis commented 6 years ago

Hi @LucasDvp you should post the body, or upload the binary artifact to Minio or S3, then only send the URL to the function. Assume your function is read-only and stateless.

What data were you trying to post?

Alex

badkk commented 6 years ago

Sorry about the delay, this issue has been resolved. And the problem is like @alexellis said, it's the way I bad requested from Postman.

alexellis commented 6 years ago

No probs!