I want to test my react/ node.js web app with a production build. I already run npm run build
at the app directory and created build folder.
I was unable to run the application using localhost:8080 (server port).
Are there any ways to double check if the application is actually running in that port or access production-ready application?
PS. I used serve to host the application but it posts error 404: The requested path could not be found
Thank you for your help.
Every SPA application has its own package.json file. Inside you have to see the script section:
Normally after you run nm run build you have a compiled version of your code. At this point, you have a see the dist
folder.
After this, you can either run npm run start
and you have to see
(this option is not suitable for SSR frameworks like NUXT or NEXT) or if you don't have that option install an npm package that renders your compiled code by doing the following:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.