airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 207 forks source link

Add option to pass an express instance in the configuration #132

Closed mindera-zecarlos closed 6 years ago

mindera-zecarlos commented 6 years ago

In our project, we need to add more middlewares than just the logger to express. Hypernova starts the server automatically and returns an express instance already initialized and we cannot add middlewares afterwords.

If we can pass the instance of express and prevent hypernova to create a new one, then we have more control over additional features to express (and maybe this is useful for other people as well). By default, if we don't pass any express instance, then hypernova will create and handle it.

stoikerty commented 6 years ago

I rebased (not sure if this is what you were looking for) but Travis seems to have a sporadic failure.

ljharb commented 6 years ago

@stoikerty a rebase would leave behind no merge commits; but it's fine if you'd prefer one of us to take care of it for you. Don't mind the travis failure - i've reran it - they've been having some issues with job timeouts.

stoikerty commented 6 years ago

Yes please. That would be nice, thanks!

ljharb commented 6 years ago

Rebased; waiting on reviews from other collabs.

stoikerty commented 6 years ago

Hey @ljharb

I know you're always mightily busy going through all these open-source repos and it's much appreciated, I know you make the rounds a lot, so sorry to be a pain. As we're progressing with the use of hypernova internally, we wanted to ask if there is an update on this PR / if there is anything we or you can do do get this in?

ljharb commented 6 years ago

@stoikerty i'll ping some folks to see about getting another review

stoikerty commented 6 years ago

woop woop 🎉 thanks guys! 😄