| 123456789101112131415161718192021222324252627282930 |
- 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<StatumModule>();
- var statum = application.configure_with<StatumConfigurator>();
- // HomePage is generated from home.html; HomeEntrypoint hydrates it and
- // embeds the login/bump action references. Actions are auto-mapped to
- // GUID endpoints; the Statum client scripts are embedded by default.
- statum.add_entrypoint_page<HomePage, HomeEntrypoint>(new EndpointRoute("/"));
- statum.add_entrypoint_page<DashboardPage, DashboardEntrypoint>(new EndpointRoute("/dashboard"));
- statum.action<LoginAction>();
- statum.action<LogoutAction>();
- statum.action<BumpCounterAction>();
- statum.add_resource<StylesResource>();
- application.run();
- } catch (Error e) {
- printerr("Error: %s\n", e.message);
- Process.exit(1);
- }
- }
|