Reputation: 11642
I would like to test my angular app on production server on custom domain.
I tried to do by this way:
I updated config into GruntFile.js
// The actual grunt server settings
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
livereload: {
options: {
open: 'http://mydomain.loc:9000',
base: [
'.tmp',
'<%= yeoman.app %>'
]
}
},
test: {
options: {
port: 9001,
base: [
'.tmp',
'test',
'<%= yeoman.app %>'
]
}
},
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
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