Problem serving dist folder in node.js locally
-
I just built my app that I want to put on a server, but first trying to test locally.
This is my quasar info:
I made a regular spa build knowing that it’s not be sitting directly in root folder on the server, so I changed publicPath:
Static frontpage files are served OK for the main page. The main page has a link pointing to ''http://localhost:3000/application" which produces blank page with this error:
#q-app does not have any content:
Network tab says connection OK:
I put my build in my application folder on the local server and tried to serve it both with express and serve-static library, which produces the same results - blank page. Here is how it looks like inside node:
Thank you for any help
-
Hi. The build, once it’s built, has nothing to do with the dev server. In other words, it’s the dev server setting, which you were changing, so it will have no effect.
Try out
quasar serve
at the root of your project. That should fire up a node web server to serve your built site/ application.Scott
-
Hi, thanks for the reply. It says it’s been deprecated and to use http-server, but I’m already running nodejs server and trying to serve the build with
app.use('/application',serveStatic(__dirname + '/application/dist/spa-mat'));
-
It says it’s been deprecated and to use http-server,
What says it’s been deprecated?
Scott
-
Says quasar CLI
I figured it out:
I changed an absolute publicPath to relative like this:
publicPath: ‘/application’That’s all it took to make it work
-
Ok. At some point you’ll need to upgrade your CLI. You are on version 15 and we are now on version 17.
Great you’ve solved the problem anyway.
Scott