From 7fe60c474b6e6cc6d918d297bf3b8337682e1c86 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 16 Oct 2017 02:58:59 +0200 Subject: [PATCH] Do not use vibe default main but instead use an own main function. --- dub.json | 5 +---- source/calendarwebapp/app.d | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dub.json b/dub.json index 3db2ce0..ddaf039 100644 --- a/dub.json +++ b/dub.json @@ -14,10 +14,7 @@ "targetPath": "generated", "configurations": [ { - "name": "executable", - "versions": [ - "VibeDefaultMain" - ] + "name": "executable" }, { "name": "unittest", diff --git a/source/calendarwebapp/app.d b/source/calendarwebapp/app.d index d6c35c9..0010348 100644 --- a/source/calendarwebapp/app.d +++ b/source/calendarwebapp/app.d @@ -5,6 +5,7 @@ import calendarwebapp.configuration : Context; import poodinis; +import vibe.core.core : runApplication; import vibe.core.log : logInfo; import vibe.http.fileserver : serveStaticFiles; @@ -12,7 +13,7 @@ import vibe.http.router : URLRouter; import vibe.http.server : HTTPServerSettings, listenHTTP, MemorySessionStore; import vibe.web.web : registerWebInterface; -shared static this() +void main() { auto container = new shared DependencyContainer(); container.registerContext!Context; @@ -26,6 +27,5 @@ shared static this() settings.bindAddresses = ["::1", "127.0.0.1"]; settings.sessionStore = new MemorySessionStore; listenHTTP(settings, router); - - logInfo("Please open http://127.0.0.1:8080/ in your browser."); + runApplication(); }