classafBedSheet::BedSheetBuilder
sys::Obj afBedSheet::BedSheetBuilder
Use to programmatically create and launch BedSheet server instances.
useDevProxy := true BedSheetBuilder(AppModule#).startWisp(8069, useDevProxy, "dev")
- addModule
This addModule(Type moduleType)
Adds a module to the registry. Any modules defined with the
@SubModule
facet are also added.Convenience for
registryBuilder.addModule()
- addModules
This addModules(Type[] moduleTypes)
Adds many modules to the registry
Convenience for
registryBuilder.addModules()
- addModulesFromPod
This addModulesFromPod(Str podName, Bool addDependencies := true)
Inspects the pod's meta-data for the key
afIoc.module
. This is then treated as a CSV list of (qualified) module type names to load.If
addDependencies
istrue
then the pod's dependencies are also inspected for IoC modules.Convenience for
registryBuilder.addModulesFromPod()
- appName
Str appName { private set }
The application name. Taken from the app pod's
proj.name
meta, or the pod name if the meta doesn't exist. Read only.- build
Registry build()
Builds the IoC
Registry
. Note that this does NOT callstartup()
on the registry.- make
new make(Str appName, Bool addPodDependencies := true)
Creates a
BedSheetBuilder
.appName
may be a pod name or a qualifiedAppModule
type name.addPodDependencies
is only used if a pod name is passed in.- makeFromType
new makeFromType(Type appModule)
Creates a
BedSheetBuilder
from anAppModule
type.- options
Str:Obj? options { private set }
Returns the options from the IoC
RegistryBuilder
.- port
Int port
The HTTP port to run the app on. Defaults to
8069
- registryBuilder
RegistryBuilder registryBuilder { private set }
The underlying IoC
RegistryBuilder
. Read only.- setIpAddress
This setIpAddress(IpAddr? ipAddr)
Sets the local IP address that Wisp should bind to, or set to
null
for the default.This is useful when deploying your application to Open Shift or similar where the local IP address is mandated. See the Fantom Forum topic: IP address for afBedSheet.
- setOption
This setOption(Str name, Obj? value)
Sets a value in the
options
map. Returnsthis
so it may be used as a builder method.- startWisp
Int startWisp(Int port := 8069, Bool proxy := false, Str? env := null)
Convenience method to start a Wisp server running BedSheet.