From 6cb7bc5f98a53527eb10d12999157dc0f5d2d0c8 Mon Sep 17 00:00:00 2001 From: Nikolay Ivanushkin Date: Fri, 3 Apr 2020 11:50:55 +0300 Subject: [PATCH] Fix #31 default route for root path --- src/cli.coffee | 4 ++-- src/server.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.coffee b/src/cli.coffee index 7acf1cc..879d4f6 100644 --- a/src/cli.coffee +++ b/src/cli.coffee @@ -31,8 +31,8 @@ program {port, host, logs, root, index, https, key, cert, cors, notFound, timeout} = program root = path.resolve _.head(program.args) if _.head(program.args) -srv = new Server {port, host, logs, root, index, https, key, cert, cors, notFound, timeout}, null, -> - console.log 'Server was shutdown at ' + new Date().toJSON() +srv = new Server {port, host, logs, root, index, https, key, cert, cors, notFound, timeout}, null, null, -> + console.log '\nServer was shutdown at ' + new Date().toJSON() process.on 'SIGINT', -> srv.stop -> process.exit() process.on 'SIGTERM', -> srv.stop -> process.exit() diff --git a/src/server.coffee b/src/server.coffee index 746ada9..aa054eb 100644 --- a/src/server.coffee +++ b/src/server.coffee @@ -59,7 +59,7 @@ class Server Object.defineProperty @, '_routes', get: -> return _.concat routes, - pattern: '**/*' + pattern: '**' handler: 'file' set: (newRoutes)->