Replies: 2 comments
-
Looks like I mentioned the same problem #344 :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
It should be possible to do this with an integration. Vite uses |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello and thanks for building Astro! I'm just getting started so hopefully this isn't an obvious question.
I have a large Express app that I would like to add Astro to. I'm able to use the Node adapter in middleware mode and add Astro to my production Express app. However, during development, I don't see a way to run my Astro app as an Express middleware since
astro dev
starts up a standalone Vite server with all of the HMR goodness and never connects it to Express.I've tried to copy most of https://github.com/withastro/astro/blob/main/packages/astro/src/core/dev/index.ts and pass along the middleware flag to
createVite()
, e.g.createVite({ server: { middlewareMode: true } })
and then use the returned middleware with my Express app, e.g.app.use(createVite(...))
. However, the Astro package doesn't export the necessary modules to enable this approach.Is there some other way to do this? The node adapter fits the bill for production, but how about in dev mode?
Thanks!
ps. I tried asking in Discord first before opening this question.
Beta Was this translation helpful? Give feedback.
All reactions