From f93c258d14b01f157783a093b3e5776aab040af7 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Wed, 24 Feb 2016 18:37:03 +0300 Subject: [PATCH] index + default args --- src/routes/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/index.js b/src/routes/index.js index 74bbdccf..b19781ed 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -45,9 +45,7 @@ export function accepts(routes, def) { }; } -export function index(filename) { - if (!filename) filename = config['defaultIndex']; - +export function index(filename = config['defaultIndex']) { return function *() { this.type = 'text/html'; this.body = fs.createReadStream(filename);