using Inversion; using Astralis; namespace Spry { public class SpryModule : Object, Module { public void register_components (Container container) throws Error { container.register_singleton(); container.register_scoped(); container.register_startup() .as() .with_metadata(new EndpointRoute("/_spry/cnu/{token}")); container.register_startup() .as() .with_metadata(new EndpointRoute("/_spry/res/{resource}")); container.register_scoped() .as() .with_metadata(new EndpointRoute("/_spry/com/{component-id}/{action}")); container.register_startup() .as(); container.register_startup() .as(); } } public class SpryConfigurator : Object { private Container container = inject(); public void add_template(string prefix) { container.register_transient() .as () .with_metadata(new TemplateRoutePrefix(prefix)); } } }