using Astralis; using Inversion; using Statum; using Example; void main(string[] args) { int port = args.length > 1 ? int.parse(args[1]) : 8080; try { var application = new WebApplication(port); application.use_compression(); application.add_module(); var statum = application.configure_with(); // HomePage is generated from home.html; HomeEntrypoint hydrates it. // The Statum client scripts (statum.js / statum-worker.js) are embedded in // the library and served by default, so only the page-specific CSS needs // registering here. statum.add_entrypoint_page(new EndpointRoute("/")); statum.add_action(new EndpointRoute("/login", Method.POST)); statum.add_action(new EndpointRoute("/logout", Method.POST)); statum.add_resource(); application.run(); } catch (Error e) { printerr("Error: %s\n", e.message); Process.exit(1); } }