summary refs log tree commit diff homepage
path: root/src/http.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.cr')
-rw-r--r--src/http.cr11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http.cr b/src/http.cr
index 9562c2e..95a3069 100644
--- a/src/http.cr
+++ b/src/http.cr
@@ -36,13 +36,18 @@ def http_error(context, status, message = nil)
 end
 
 class Server
+  @sock : String
+
   def initialize(cfg)
+    @sock = cfg.sock
     @db = Database.new cfg.db, cfg.opennic_remote, cfg.icann_remote
 
     @opennic_host = URI.parse(cfg.opennic_remote).host
-    @opennic_page = Page.new cfg.opennic_local, cfg.opennic_remote, cfg.api, @db
+    @opennic_page = Page.new cfg.opennic_local, cfg.opennic_remote,
+                             cfg.opennic_api, cfg.css, @db
     @opennic_page.write
-    @icann_page = Page.new cfg.icann_local, cfg.icann_remote, cfg.api, @db
+    @icann_page = Page.new cfg.icann_local, cfg.icann_remote,
+                           cfg.icann_api, cfg.css, @db
     @icann_page.write
 
     @server = HTTP::Server.new do |context|
@@ -140,7 +145,7 @@ class Server
       end
     }, self.as Void*
 
-    yield @server.bind_tcp port
+    yield @server.bind_unix @sock
     @server.listen
   end