OJR
OJR

Reputation: 21

How to access VueJS on codeanywhere

there. I´m starting on VueJS, creating a project in codeanywhere:

npm install -g vue-cli
vue init webpack myProject

So, when i run npm run devi get a

Your application is running here: http://localhost:8080

Because, i am developing on a cloud based IDE, i´cant access http://localhost... So, i access the way Codeanywhere publish when you create a project:

https://myProject-XXXXXXXX.codeanyapp.com/

But i get a

This Container is currently unaccessible.

Really appreciated any help.

Upvotes: 1

Views: 824

Answers (3)

Nukz
Nukz

Reputation: 11

Work for me with nuxt.config.js :

server: {
    port: 3000,
    host: '0.0.0.0',
    timing: false
  },

Upvotes: 1

fidoogle
fidoogle

Reputation: 91

I created a vue.config.js file at the root (next to package.json) with content:

module.exports = {
  devServer: {
    host: '0.0.0.0',
    allowedHosts: [
      '.codeanyapp.com'
    ]
  }
};

Upvotes: 4

Laurens Deprost
Laurens Deprost

Reputation: 1691

From the Codeanywhere documentation:

You have to change the default IP so your Container could run externally.
Please change IP address on your container from 127.0.0.1 to 0.0.0.0.

Upvotes: 2

Related Questions