From 750297e3419eb4a19e5f78adba3e7de904fef957 Mon Sep 17 00:00:00 2001 From: Martijn Vermaat Date: Thu, 31 Mar 2016 14:09:15 +0200 Subject: [PATCH] Allow missing trailing slash in root route Fixes #18 --- scripts/app.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/app.coffee b/scripts/app.coffee index 61571d5..67c6c49 100644 --- a/scripts/app.coffee +++ b/scripts/app.coffee @@ -216,10 +216,6 @@ app = Sammy '#main', -> throw new ApiError 'mygeneinfo_error', "MyGene.info query failed: #{ @params.query }" - # Homepage. - @get '/', -> - @show 'home' - # Authenticate. @post '/authenticate', -> $('#form-authenticate').removeClass 'success fail' @@ -906,5 +902,10 @@ app = Sammy '#main', -> @show 'variants', data .catch ApiError, ({message}) => @error message + # Homepage. + # This route acts as a catchall and must be defined last. + @get '', -> + @show 'home' + module.exports = app