mirror of https://github.com/keeweb/keeweb.git
enhance: add web-server message with host bind
This commit is contained in:
parent
2dadb52d82
commit
4c7897e934
46
Gruntfile.js
46
Gruntfile.js
|
@ -358,6 +358,29 @@ module.exports = function (grunt) {
|
||||||
options: appConfig,
|
options: appConfig,
|
||||||
start: {
|
start: {
|
||||||
devServer: {
|
devServer: {
|
||||||
|
setupMiddlewares: function (middlewares, devServer) {
|
||||||
|
const port = devServer.options.port;
|
||||||
|
const https = devServer.options.https ? 's' : '';
|
||||||
|
|
||||||
|
const domain1 = `http${https}://${devServer.options.host}:${port}`;
|
||||||
|
const domain2 = `http://[::1]:${port}`;
|
||||||
|
|
||||||
|
grunt.log.writeln(
|
||||||
|
`\n---------------------------------------------------------------------`
|
||||||
|
.grey.bold
|
||||||
|
);
|
||||||
|
grunt.log.writeln(
|
||||||
|
` KeeWeb server succesfully started! Access it at:\n`.yellow.bold
|
||||||
|
);
|
||||||
|
grunt.log.writeln(` → ${domain1}`.green.bold);
|
||||||
|
grunt.log.writeln(` → ${domain2}`.green.bold);
|
||||||
|
grunt.log.writeln(
|
||||||
|
`---------------------------------------------------------------------\n\n`
|
||||||
|
.grey.bold
|
||||||
|
);
|
||||||
|
|
||||||
|
return middlewares;
|
||||||
|
},
|
||||||
port: 8085,
|
port: 8085,
|
||||||
client: {
|
client: {
|
||||||
logging: 'error',
|
logging: 'error',
|
||||||
|
@ -365,32 +388,25 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
hot: 'only',
|
hot: 'only',
|
||||||
static: [
|
static: [
|
||||||
|
/*
|
||||||
|
publicPath: ['/static-public-path-one/', '/static-public-path-two/'],
|
||||||
|
serveIndex: {}
|
||||||
|
https://github.com/expressjs/serve-index
|
||||||
|
watch: {}
|
||||||
|
https://github.com/paulmillr/chokidar
|
||||||
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
directory: path.resolve(__dirname, 'tmp'),
|
directory: path.resolve(__dirname, 'tmp'),
|
||||||
staticOptions: {},
|
staticOptions: {},
|
||||||
// Don't be confused with `devMiddleware.publicPath`, it is `publicPath` for static directory
|
|
||||||
// Can be:
|
|
||||||
// publicPath: ['/static-public-path-one/', '/static-public-path-two/'],
|
|
||||||
publicPath: '/',
|
|
||||||
// Can be:
|
|
||||||
// serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)
|
|
||||||
serveIndex: true,
|
serveIndex: true,
|
||||||
// Can be:
|
|
||||||
// watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)
|
|
||||||
watch: true
|
watch: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
directory: path.resolve(__dirname, 'app/content'),
|
directory: path.resolve(__dirname, 'app/content'),
|
||||||
staticOptions: {},
|
staticOptions: {},
|
||||||
// Don't be confused with `devMiddleware.publicPath`, it is `publicPath` for static directory
|
|
||||||
// Can be:
|
|
||||||
// publicPath: ['/static-public-path-one/', '/static-public-path-two/'],
|
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
// Can be:
|
|
||||||
// serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)
|
|
||||||
serveIndex: true,
|
serveIndex: true,
|
||||||
// Can be:
|
|
||||||
// watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)
|
|
||||||
watch: true
|
watch: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue