aboutsummaryrefslogtreecommitdiff
path: root/src/guff/handler.cr
blob: 357ed1fbb89e0d807763d6f8a6b24d5786d73258 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "http/server"

module Guff
  class Handler < ::HTTP::Handler
    getter :model

    def initialize(@models : Models)
    end

    def call(context : HTTP::Server::Context)
      # do nothing by default
      call_next(context)
    end

    private def redirect(context, url : String)
      context.response.status_code = 302
      context.response.headers["location"] = url
    end
  end
end