I have not tried this yet, but I would like each module (Silverlight) to register its own routes, rather then adding it in application start.
Can routes be added to AppHost after application start, or do they all have to be immediatelly registered during Configure step?
I am thinking to scan all assemblies at the startup and provide AppHost with all assemblies that implement service stack services, but let each module add its own routes (have not figured out yet exact mechanism.
Before I go down this route, need to know if it is possible to add routes after the Configure step.
All configuration and registration in ServiceStack should be done within the
AppHost.Configure()
method and remain immutable thereafter.If you want to encapsulate registrations of routes in a module than package it as a Plugin and register them manually on
IPlugin.Register(IAppHost)
.Here are some different ways to register routes:
Then inside your AppHost.Configure you would register the Plugin, e.g: