From 8cf04b58cafd09c6b570a4182a49ae99abc1da72 Mon Sep 17 00:00:00 2001 From: Zamith Date: Sat, 31 Jan 2015 14:39:50 +0000 Subject: [PATCH] Move static file handler to be called after the instance handler This way only routes that are not caught by the instance handler will go through to the static file handler. --- spec/frank_handler_spec.cr | 2 +- spec/route_spec.cr | 2 +- src/frank.cr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/frank_handler_spec.cr b/spec/frank_handler_spec.cr index e9ef151..06faa5e 100644 --- a/spec/frank_handler_spec.cr +++ b/spec/frank_handler_spec.cr @@ -1,4 +1,4 @@ -require "spec_helper" +require "./spec_helper" describe "Frank::Handler" do it "routes" do diff --git a/spec/route_spec.cr b/spec/route_spec.cr index 1a5dfdc..3842654 100644 --- a/spec/route_spec.cr +++ b/spec/route_spec.cr @@ -1,4 +1,4 @@ -require "spec_helper" +require "./spec_helper" describe "Route" do describe "match" do diff --git a/src/frank.cr b/src/frank.cr index 48941f8..74b0361 100644 --- a/src/frank.cr +++ b/src/frank.cr @@ -11,8 +11,8 @@ at_exit do config = Frank.config handlers = [] of HTTP::Handler handlers << HTTP::LogHandler.new - handlers << HTTP::StaticFileHandler.new("./public") handlers << Frank::Handler::INSTANCE + handlers << HTTP::StaticFileHandler.new("./public") server = HTTP::Server.new(config.port, handlers) server.ssl = config.ssl