26 lines
695 B
D
26 lines
695 B
D
module d_webservice_example.application;
|
|
|
|
import aermicioi.aedi : locate, singleton;
|
|
import vibe.vibe;
|
|
|
|
void main() @safe
|
|
{
|
|
import d_webservice_example.component_registration : registerComponents;
|
|
import d_webservice_example.controller.todo_controller : TodoController;
|
|
|
|
auto container = singleton;
|
|
scope (exit)
|
|
container.terminate;
|
|
|
|
container.registerComponents;
|
|
container.instantiate;
|
|
|
|
auto router = new URLRouter;
|
|
router.registerRestInterface(container.locate!TodoController);
|
|
auto settings = new HTTPServerSettings;
|
|
settings.port = 8080;
|
|
settings.bindAddresses = ["::", "0.0.0.0"];
|
|
listenHTTP(settings, router);
|
|
|
|
runApplication;
|
|
}
|