parent
7a71bb7e01
commit
639118f781
|
@ -27,6 +27,10 @@ private void showVersion() {
|
||||||
writefln("daster версия %s, собрано %s", getDasterVersion(), __DATE__);
|
writefln("daster версия %s, собрано %s", getDasterVersion(), __DATE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void page404(HTTPServerRequest req, HTTPServerResponse res, HTTPServerErrorInfo error) {
|
||||||
|
res.render!("404.dt", req, error);
|
||||||
|
}
|
||||||
|
|
||||||
int main(string[] args) {
|
int main(string[] args) {
|
||||||
log.level(log.INFORMATION);
|
log.level(log.INFORMATION);
|
||||||
log.output(log.SYSLOG);
|
log.output(log.SYSLOG);
|
||||||
|
@ -99,12 +103,14 @@ int main(string[] args) {
|
||||||
auto settingsHTTPS = new HTTPServerSettings;
|
auto settingsHTTPS = new HTTPServerSettings;
|
||||||
|
|
||||||
if (webHost.http) {
|
if (webHost.http) {
|
||||||
|
settingsHTTP.errorPageHandler = toDelegate(&page404);
|
||||||
settingsHTTP.sessionStore = memorySessionStore;
|
settingsHTTP.sessionStore = memorySessionStore;
|
||||||
settingsHTTP.port = webHost.http;
|
settingsHTTP.port = webHost.http;
|
||||||
settingsHTTP.bindAddresses = ["::1"] ~ webHost.addresses;
|
settingsHTTP.bindAddresses = ["::1"] ~ webHost.addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (webHost.https) {
|
if (webHost.https) {
|
||||||
|
settingsHTTPS.errorPageHandler = toDelegate(&page404);
|
||||||
settingsHTTPS.sessionStore = memorySessionStore;
|
settingsHTTPS.sessionStore = memorySessionStore;
|
||||||
settingsHTTPS.port = webHost.https;
|
settingsHTTPS.port = webHost.https;
|
||||||
settingsHTTPS.bindAddresses = ["::1"] ~ webHost.addresses;
|
settingsHTTPS.bindAddresses = ["::1"] ~ webHost.addresses;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
module version_;
|
module version_;
|
||||||
|
|
||||||
enum dasterVersion = "v0.0.8";
|
enum dasterVersion = "v0.0.9";
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
doctype html
|
||||||
|
head
|
||||||
|
title 404
|
||||||
|
body
|
||||||
|
div
|
||||||
|
p Страница не найдена
|
Loading…
Reference in New Issue