| 12345678910111213141516171819202122232425262728293031 |
- 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. Routes come from each page's
- // <pstm-uri>; actions are auto-mapped to GUID endpoints; the Statum
- // client scripts are embedded by default.
- statum.add_page<HomePage, HomeEntrypoint>();
- statum.add_page<DashboardPage, DashboardEntrypoint>();
- 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);
- }
- }
|