diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-03-06 17:29:50 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-03-06 17:29:50 -0500 |
commit | b1395163fa45ed788af4d2d003c1dd49846d86ee (patch) | |
tree | 39ba885f3a7d51836f13c59e1f6f6d01dc756071 /src/guff/server.cr | |
parent | 5a57a15f5e154b2e2dc312b1e92600449c6ca1f9 (diff) | |
download | old-guff-b1395163fa45ed788af4d2d003c1dd49846d86ee.tar.bz2 old-guff-b1395163fa45ed788af4d2d003c1dd49846d86ee.zip |
add model mapper and stub post and tag models
Diffstat (limited to 'src/guff/server.cr')
-rw-r--r-- | src/guff/server.cr | 20 |
1 files changed, 10 insertions, 10 deletions
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 |