blob: 7b7c3fd1c86d0e39bd93c68ca985e88bdf415bfb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import brpaste;
import vibe.d;
int main(string[] args)
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
settings.bindAddresses = [];
readOption("bind|b", &settings.bindAddresses, "Sets the address to bind to");
readOption("port|p", &settings.port, "Sets the port to listen on");
if(settings.bindAddresses.length == 0) settings.bindAddresses = [ "127.0.0.1" ];
auto router = new URLRouter;
router.registerWebInterface(new BRPaste);
listenHTTP(settings, router);
import std.conv;
logInfo("Please open http://%s:%d/ in your browser.", settings.bindAddresses[0], settings.port);
return runApplication();
}
|