No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Problem serving dist folder in node.js locally

    CLI
    2
    6
    1923
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      besthost last edited by besthost

      I just built my app that I want to put on a server, but first trying to test locally.
      This is my quasar info:
      0_1538911223821_quasar-info.PNG

      I made a regular spa build knowing that it’s not be sitting directly in root folder on the server, so I changed publicPath:
      0_1538911318127_quasar-conf.PNG

      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:
      0_1538911780829_consoleError.PNG

      #q-app does not have any content:
      0_1538912215267_htmlEl.png

      Network tab says connection OK:
      0_1538911814750_network.png

      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:
      0_1538911881384_nodeServer.PNG

      Thank you for any help 🙂

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        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

        1 Reply Last reply Reply Quote 0
        • B
          besthost last edited by besthost

          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'));

          0_1538949404200_testServer.PNG

          s.molinari 1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari @besthost last edited by

            @besthost

            It says it’s been deprecated and to use http-server,

            What says it’s been deprecated?

            Scott

            1 Reply Last reply Reply Quote 0
            • B
              besthost last edited by besthost

              Says quasar CLI 🙂
              0_1539013575094_depr.PNG

              I figured it out:
              I changed an absolute publicPath to relative like this:
              publicPath: ‘/application’

              That’s all it took to make it work 🙂

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by s.molinari

                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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post