N
Nuxt13mo ago
Flash

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
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
fsyntax
fsyntax6mo ago
@Flash did you find any solution to this?
Flash
FlashOP6mo ago
Used a subdomain for the api
Dubem
Dubem6mo ago
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
Want results from more Discord servers?
Add your server