mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 05:45: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,
|
open: true,
|
||||||
livereload: 35729,
|
livereload: 35729,
|
||||||
// Change this to '0.0.0.0' to access the server from outside
|
// Change this to '0.0.0.0' to access the server from outside
|
||||||
hostname: 'localhost'
|
hostname: '0.0.0.0'
|
||||||
},
|
},
|
||||||
livereload: {
|
livereload: {
|
||||||
options: {
|
options: {
|
||||||
middleware: function(connect) {
|
middleware: function(connect) {
|
||||||
return [
|
return [
|
||||||
connect.static('.tmp'),
|
connect.static('.tmp'),
|
||||||
connect().use('/bower_components', connect.static('./bower_components')),
|
connect().use('/bower_components', connect.static(
|
||||||
|
'./bower_components')),
|
||||||
connect.static(config.app)
|
connect.static(config.app)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -96,7 +97,8 @@ module.exports = function (grunt) {
|
||||||
return [
|
return [
|
||||||
connect.static('.tmp'),
|
connect.static('.tmp'),
|
||||||
connect.static('test'),
|
connect.static('test'),
|
||||||
connect().use('/bower_components', connect.static('./bower_components')),
|
connect().use('/bower_components', connect.static(
|
||||||
|
'./bower_components')),
|
||||||
connect.static(config.app)
|
connect.static(config.app)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -144,7 +146,9 @@ module.exports = function (grunt) {
|
||||||
all: {
|
all: {
|
||||||
options: {
|
options: {
|
||||||
run: true,
|
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: {
|
app: {
|
||||||
ignorePath: /^\/|\.\.\//,
|
ignorePath: /^\/|\.\.\//,
|
||||||
src: ['<%= config.app %>/index.html'],
|
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: {
|
sass: {
|
||||||
src: ['<%= config.app %>/styles/{,*/}*.{scss,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')) {
|
if (grunt.option('allow-remote')) {
|
||||||
grunt.config.set('connect.options.hostname', '0.0.0.0');
|
grunt.config.set('connect.options.hostname', '0.0.0.0');
|
||||||
}
|
}
|
||||||
|
@ -384,7 +392,9 @@ module.exports = function (grunt) {
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask('server', function(target) {
|
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']);
|
grunt.task.run([target ? ('serve:' + target) : 'serve']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue