-
Notifications
You must be signed in to change notification settings - Fork 49
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
res object seems to be missing setHeader() #2
Comments
Has anybody found a work around? |
@ejferg To be honest, after quite a bit of time looking at options, including connect rather than express, I decide this was not a good approach for several reasons.
So while using Express and middleware seems like a neat idea in reality I don't think it makes much sense. Here's a post I did on static serving in Azure |
@ejferg @SteveALee Hi thanks for reporting the issue.. I'll have a look quite soon ;) PS: Feel free to make a PR |
@SteveALee Thank you so much for reporting this issue 😄 It's now fixed in v1.2.0 I didn't notice the error because I'm disabling @ejferg @SteveALee Please give it a try and let me know. @SteveALee Unrelated to this issue, but you consider moving from express 2.x to express 4.x as express 2.x is no longer maintained and have security and performance issues (source: http://expressjs.com/2x/) @SteveALee This package is good (and fast enough) for managing API endpoints with routing. If you need streaming feature, feel free to make a PR.. 😃 I know Azure Function is improving and may support streaming (soon or already?). PS: Known workaround consisting in disabling |
Thanks for the fix. I spent quite a bit of time with the Express code and didn't spot I think I used express 2.x as your example had and I wasn't sure if newer version might have broken you mocking of the HTTP objects. I will certainly try it sometime. I totally agree it's a great approach for an API serving JSON payloads. I wanted a solution for that and serving my static objects (index.html etc). Seems in that case I got a bit carried away :) I might revisit it sometime. It seemed to me that Functions only support strings for buffers (ie in memory copies) rather than streaming from files. That's fine for dev but not for production. Thanks again for getting back to me. |
This looks like an excellent solution for a low bandwidth web serving using functions - eg static pages for a SPA.
however I'm getting an error using your example in the finalhandler module used by express. It appears your mock response object is missing
setHeader()
express: 2.5.11
finalhandler: 0.5.0
https://github.com/pillarjs/finalhandler/blob/master/index.js#L202
Perhaps the issues is your code is written for a specific version of express and they're been breaking changes since?
The text was updated successfully, but these errors were encountered: