redrom
redrom

Reputation: 11642

Grunt server how to set hostname and virtual host correctly?

I would like to test my angular app on production server on custom domain.

I tried to do by this way:

After this i run server using grunt serve command.

Grunt is initialized, browser window is opened at correct address mydomain.loc:9000

But server cannot be found in browser.

Question is:

What i'm doing wrong and how can i solve it?

I suppose, that Apache is not needed for this?

Thanks for any advice.

Upvotes: 3

Views: 4833

Answers (1)

teone
teone

Reputation: 2183

As stated in this answer: Grunt server does not use virtual host name for my app..vhost and httpd are set up but grunt is not using them

The hostname option is only used to specify where livereload should connect to. This doesn't change the default url which is opened when you start Grunt. What you need is to specify a URL for open in your livereload options. For example:

livereload: {
    options: {
        open: 'http://myapp.dev:9000',
        base: [
            '.tmp',
            '<%= yeoman.app %>'
        ]
    }
}

Upvotes: 1

Related Questions