Replies: 2 comments 2 replies
-
I agree, I think there's a use-case for this. Right now, it's a totally valid case to call What about a new option: We should default to Would love a PR if you're interested in adding! |
Beta Was this translation helpful? Give feedback.
-
Draft version of the PR is up. edit: helps if I add a link to the PR #2314 |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to transform my current server to use snowpack to handle my client side code generation.
My client and server share a lot of code, (it handles SSR) as well as the api.
My current approach (can probably be simplified) is as follows.
SnowpackDevServer::handleRequest(req, res)
nodemon
to restart my api server on file changes.Although I use the handlers on
SnowpackDevServer
, I don't really use the server that it spins up.My thought would be to create a
createDevServer
that does everything thatstartDevServer
does except for starting up the server.startDevServer
could callcreateDevServer
interally, spin up thehttp
server, and use it to handle requests in the same way that it is now. This should keep the symantics (and api) ofstartDevServer
the same, but allow consumers to usecreateDevServer
, if needed, to easily hook into their own custom server implementations.Thoughts?
I would be willing to send a PR if you're interested.
Beta Was this translation helpful? Give feedback.
All reactions