Closed raulfdm closed 4 months ago
Found another issue:
In our app we don't use this alias. :/
Instead we use $
The updated v0.2.0 lets you own the server. In development, you configure the Vite server using the server
config in vite.config.ts.
For production, you can create your own server via the createServer
option.
Closing issue. Please try the latest and see if this solves your issue.
Hey @kiliman 👋
First, thanks for this project, really useful. The code is pretty straight, but it's nice having the community try to solve this once so we don't have to repeat the same solution repeatedly.
I'm trying to replace our custom express setup, but I encounter 2 limitations using this plugin (maybe due to lack of express knowledge).
The first is straightforward I guess. In our code, in the app.listen call back, we start a background process:
Is it possible to accept a
listenerCallback
tocreateExpressApp
? It could either replace entirely this: https://github.com/kiliman/remix-express-vite-plugin/blob/00491fe27953c39b7affc8b61213656424f41ddd/src/express.ts#L75-L77Or just be invoked (if sent) by passing the port.
The second thing is, in the previous code snippet, we use the
server
returned byapp.listen
to bind loggers when the server is shutdown:Something like this:
So, my question is: can we have access to the server object?
Here I'm not quite sure about the right abstraction, specially because we only start listening when it's prod (out of vite): https://github.com/kiliman/remix-express-vite-plugin/blob/00491fe27953c39b7affc8b61213656424f41ddd/src/express.ts#L74-L78
I'm not sure if we could call
configure
later and have something like this:(not sure if that would work)
Let me know what you think :)
Thanks