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

Add a middleware #35

Open
BigAB opened this issue Jun 8, 2017 · 4 comments
Open

Add a middleware #35

BigAB opened this issue Jun 8, 2017 · 4 comments

Comments

@BigAB
Copy link

BigAB commented Jun 8, 2017

I don't know if this is a common issue, but right now I needed to start a DoneJS app, and I need to add one little middleware to the project. (in this case an custom-auth middleware)

So, currently, to make that work, and still enjoy the benefits of the live-reloading, server-rendering, SPA'ing done-serve stuff, I basically had to copy-pasta all the done-serve code into a server.js file, and run that instead. Not horrible, but I feel it would be a lot cooler if I could just set some config or something donejs add middleware my-middleware and have it work out for me.

I know it doesn't have this right now but...

sure-would

@matthewp
Copy link
Contributor

matthewp commented Jun 8, 2017

:D Another alternative would be to spin off the live-reload and other stuff into some type of middlewary thing that could be consumed more easily without the copy pasting.

@matthewp
Copy link
Contributor

Also note that done-serve is a development server. I'm wary of adding features that might cause people to depend on it, and use it in production.

@frank-dspeed
Copy link

@matthewp @BigAB wouldnt the proxy feature be here the right method? create a little express middelware server and then use the proxy option over that ?

@matthewp
Copy link
Contributor

With the new version of done-serve (3.0) you can provide a configure function which allows you to directly insert middleware. This is what place-my-order does now. However this needs to be documented.

@matthewp matthewp added the p4 label Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants