parent
7a71bb7e01
commit
639118f781
|
@ -27,6 +27,10 @@ private void showVersion() {
|
|||
writefln("daster версия %s, собрано %s", getDasterVersion(), __DATE__);
|
||||
}
|
||||
|
||||
void page404(HTTPServerRequest req, HTTPServerResponse res, HTTPServerErrorInfo error) {
|
||||
res.render!("404.dt", req, error);
|
||||
}
|
||||
|
||||
int main(string[] args) {
|
||||
log.level(log.INFORMATION);
|
||||
log.output(log.SYSLOG);
|
||||
|
@ -99,12 +103,14 @@ int main(string[] args) {
|
|||
auto settingsHTTPS = new HTTPServerSettings;
|
||||
|
||||
if (webHost.http) {
|
||||
settingsHTTP.errorPageHandler = toDelegate(&page404);
|
||||
settingsHTTP.sessionStore = memorySessionStore;
|
||||
settingsHTTP.port = webHost.http;
|
||||
settingsHTTP.bindAddresses = ["::1"] ~ webHost.addresses;
|
||||
}
|
||||
|
||||
if (webHost.https) {
|
||||
settingsHTTPS.errorPageHandler = toDelegate(&page404);
|
||||
settingsHTTPS.sessionStore = memorySessionStore;
|
||||
settingsHTTPS.port = webHost.https;
|
||||
settingsHTTPS.bindAddresses = ["::1"] ~ webHost.addresses;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
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