Merge branch 'no-vibe-default-main' into 'master'
Do not use vibe default main but instead use an own main function. See merge request fsimphy/calendar-webapp!5
This commit is contained in:
commit
bebb5079c4
2 changed files with 4 additions and 7 deletions
5
dub.json
5
dub.json
|
@ -19,10 +19,7 @@
|
||||||
"targetPath": "generated",
|
"targetPath": "generated",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "executable",
|
"name": "executable"
|
||||||
"versions": [
|
|
||||||
"VibeDefaultMain"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "unittest",
|
"name": "unittest",
|
||||||
|
|
|
@ -5,6 +5,7 @@ import calendarwebapp.configuration : Context;
|
||||||
|
|
||||||
import poodinis;
|
import poodinis;
|
||||||
|
|
||||||
|
import vibe.core.core : runApplication;
|
||||||
import vibe.core.log : logInfo;
|
import vibe.core.log : logInfo;
|
||||||
|
|
||||||
import vibe.http.fileserver : serveStaticFiles;
|
import vibe.http.fileserver : serveStaticFiles;
|
||||||
|
@ -12,7 +13,7 @@ import vibe.http.router : URLRouter;
|
||||||
import vibe.http.server : HTTPServerSettings, listenHTTP, MemorySessionStore;
|
import vibe.http.server : HTTPServerSettings, listenHTTP, MemorySessionStore;
|
||||||
import vibe.web.web : registerWebInterface;
|
import vibe.web.web : registerWebInterface;
|
||||||
|
|
||||||
shared static this()
|
void main()
|
||||||
{
|
{
|
||||||
auto container = new shared DependencyContainer();
|
auto container = new shared DependencyContainer();
|
||||||
container.registerContext!Context;
|
container.registerContext!Context;
|
||||||
|
@ -26,6 +27,5 @@ shared static this()
|
||||||
settings.bindAddresses = ["::1", "127.0.0.1"];
|
settings.bindAddresses = ["::1", "127.0.0.1"];
|
||||||
settings.sessionStore = new MemorySessionStore;
|
settings.sessionStore = new MemorySessionStore;
|
||||||
listenHTTP(settings, router);
|
listenHTTP(settings, router);
|
||||||
|
runApplication();
|
||||||
logInfo("Please open http://127.0.0.1:8080/ in your browser.");
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue