I use IIS in Windows to run several web page servers. And this time, I studied Nuxt.js. Build a project created with Nuxt.js using the "npm run build" command. I know that if you go into that folder and "npm run dev", the server opens on port 3000. At this time, instead of "http://example.com:3000" on the web browser, I would like to launch the service through "http://example.com". How shall I do it?
- Is there a way to set it up in IIS Manager?
- If not, should we consider a new web server instead of IIS?
- If not, is there a way to set it up in Nuxt.js?
I tried the HTTP redirection feature in IIS Manager, but I could not get the desired result.
With HttpPlatformHandler you can easily host Nuxt.js web apps on IIS, but changes to your project are required as below,
Nuxt 2.x
The official guide to host Nuxt 2.x for Azure App Service (Windows) shows the general hints,
but it misses important steps,
expressandnuxt-startas dependencies (check yourpackage.json).const nuxt = await loadNuxt(isDev ? 'dev' : 'start')to simplyconst nuxt = await loadNuxt('start'), asisDevisn’t defined anywhere.Then your
web.configshould look similar to,Nuxt 3.0
The steps are simplified,
with
web.config,Reference