mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
Allow server access from outside
This commit is contained in:
parent
2a49046ff0
commit
5e035395b5
1 changed files with 395 additions and 385 deletions
|
@ -75,14 +75,15 @@ module.exports = function (grunt) {
|
|||
open: true,
|
||||
livereload: 35729,
|
||||
// Change this to '0.0.0.0' to access the server from outside
|
||||
hostname: 'localhost'
|
||||
hostname: '0.0.0.0'
|
||||
},
|
||||
livereload: {
|
||||
options: {
|
||||
middleware: function(connect) {
|
||||
return [
|
||||
connect.static('.tmp'),
|
||||
connect().use('/bower_components', connect.static('./bower_components')),
|
||||
connect().use('/bower_components', connect.static(
|
||||
'./bower_components')),
|
||||
connect.static(config.app)
|
||||
];
|
||||
}
|
||||
|
@ -96,7 +97,8 @@ module.exports = function (grunt) {
|
|||
return [
|
||||
connect.static('.tmp'),
|
||||
connect.static('test'),
|
||||
connect().use('/bower_components', connect.static('./bower_components')),
|
||||
connect().use('/bower_components', connect.static(
|
||||
'./bower_components')),
|
||||
connect.static(config.app)
|
||||
];
|
||||
}
|
||||
|
@ -144,7 +146,9 @@ module.exports = function (grunt) {
|
|||
all: {
|
||||
options: {
|
||||
run: true,
|
||||
urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
|
||||
urls: [
|
||||
'http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -195,7 +199,9 @@ module.exports = function (grunt) {
|
|||
app: {
|
||||
ignorePath: /^\/|\.\.\//,
|
||||
src: ['<%= config.app %>/index.html'],
|
||||
exclude: ['bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js']
|
||||
exclude: [
|
||||
'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js'
|
||||
]
|
||||
},
|
||||
sass: {
|
||||
src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
|
||||
|
@ -365,7 +371,9 @@ module.exports = function (grunt) {
|
|||
});
|
||||
|
||||
|
||||
grunt.registerTask('serve', 'start the server and preview your app, --allow-remote for remote access', function (target) {
|
||||
grunt.registerTask('serve',
|
||||
'start the server and preview your app, --allow-remote for remote access',
|
||||
function(target) {
|
||||
if (grunt.option('allow-remote')) {
|
||||
grunt.config.set('connect.options.hostname', '0.0.0.0');
|
||||
}
|
||||
|
@ -384,7 +392,9 @@ module.exports = function (grunt) {
|
|||
});
|
||||
|
||||
grunt.registerTask('server', function(target) {
|
||||
grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
|
||||
grunt.log.warn(
|
||||
'The `server` task has been deprecated. Use `grunt serve` to start a server.'
|
||||
);
|
||||
grunt.task.run([target ? ('serve:' + target) : 'serve']);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue