From 5e95bc0ca950cc18de7cc0761c5f83d40e4a4057 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 11 May 2023 12:46:39 -0500 Subject: [PATCH] updated: http-server version --- onyx-pkg.ini | 2 +- src/app.onyx | 15 ++++++++------- www/static/css/new_style.css | 2 -- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/onyx-pkg.ini b/onyx-pkg.ini index 712378e..b320fce 100644 --- a/onyx-pkg.ini +++ b/onyx-pkg.ini @@ -17,7 +17,7 @@ build_cmd= library= [dependencies] -git://onyxlang.io/repo/http-server=0.1.28 +git://onyxlang.io/repo/http-server=0.2.0 git://onyxlang.io/repo/postgres-orm=0.0.25 git://onyxlang.io/repo/otmp=0.0.8 git://onyxlang.io/repo/postgres=0.0.10 diff --git a/src/app.onyx b/src/app.onyx index d5bdd7c..4752b63 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -103,32 +103,33 @@ main :: () { } }; - app := http.server.application(); - http.server.set_mime_type("svg", "image/svg+xml"); + pipes := http.server.pipeline(); + files := http.server.static("/static/", "./www/static/"); - app->pipe(&files); + pipes->pipe(&files); #if #defined(runtime.vars.Debug) { - app->pipe((req, res) => { + pipes->pipe((req, res) => { reg->refresh_templates(); }); } router := http.server.router(); router->collect_routes(); - app->pipe(&router); + pipes->pipe(&router); - app->pipe((req, res) => { + pipes->pipe((req, res) => { if !res.completed { res->render("pages/404", null); } }); logger := http.server.logger(); - app->pipe(&logger); + pipes->pipe(&logger); + app := http.server.tcp(pipes); app->serve(8081); println("Server stopping..."); } diff --git a/www/static/css/new_style.css b/www/static/css/new_style.css index d4f87e9..325b25d 100644 --- a/www/static/css/new_style.css +++ b/www/static/css/new_style.css @@ -259,8 +259,6 @@ navbar a { /* Footer */ .footer-container { - position: sticky; - bottom: 0; display: flex; flex-direction: var(--default-flex-direction); } -- 2.25.1