Host Express and Nuxt server on same port
How would I go about hosting my nuxt server on, for example, http://localhost:3000, and an express API server on http://localhost:3000/api without them interfering with each other? There is no backend on the nuxt server.
4 Replies
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
@Flash did you find any solution to this?
Used a subdomain for the api
When you say "There is no backend on the nuxt server", is it safe to say that it is a static site/ SPA? If so, then you can build the nuxt project in /dist folder and use express to serve the built files. https://expressjs.com/en/starter/static-files.html