From b1395163fa45ed788af4d2d003c1dd49846d86ee Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 6 Mar 2016 17:29:50 -0500 Subject: add model mapper and stub post and tag models --- src/guff/server.cr | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/guff/server.cr') diff --git a/src/guff/server.cr b/src/guff/server.cr index 1d87db7..8df68fa 100644 --- a/src/guff/server.cr +++ b/src/guff/server.cr @@ -1,30 +1,30 @@ require "http/server" require "./config" -require "./model" +require "./models" require "./handlers" module Guff class Server - def self.run(model : Model) - new(model).run + def self.run(models : Models) + new(models).run end - def initialize(@model : Model) + def initialize(@models : Models) # create server @server = HTTP::Server.new( - @model.config["host"], - @model.config["port"].to_i, - get_handlers(@model) + @models.config["host"], + @models.config["port"].to_i, + get_handlers(@models) ) end def run - puts "listening on %s:%s" % %w{host port}.map { |k| @model.config[k] } + puts "listening on %s:%s" % %w{host port}.map { |k| @models.config[k] } @server.listen end - private def get_handlers(model : Model) : Array(HTTP::Handler) - @handlers ||= Handlers.get(model) + private def get_handlers(models : Models) : Array(HTTP::Handler) + @handlers ||= Handlers.get(models) end end end -- cgit v1.2.3