Search code examples
node.jsapachevue.jsserverdomain-name

Setup domain for VueJS server on network


I have a project that use a NodeJs server for back-end and VueJs for front-end. I run the front-end server using this:

npm run serve

Now, I have a domain

duduman.ro

And I want to set the domain for my app that runs on localhost:8080 I tried using apache, but i didn't succeed.(setting virtualhost)

<VirtualHost *:8080>
    ServerName duduman.ro
</VirtualHost>

I also tried to set a subdomain: app.duduman.ro for 8080 port, but calling "app.duduman.ro" return "Object not found" and calling "app.duduman.ro:8080" return "Invalid Host header".

PS: The port is forwarded correctly because external ip using port 8080 works just fine.


Solution

  • Check out Heroku node.js app, it should solve your issues.

    https://www.heroku.com/nodejs

    For me is the easiest way to deploy.