const mixinafBedSheet::BedSheetServer
afBedSheet::BedSheetServer
(Service) - Information about the BedSheet server.
- appModule
abstract Type? appModule()
The
AppModule
.- appName
abstract Str appName()
Returns
pod.dis
(orproj.name
if not found) from the application's pod meta, or the pod name if neither are defined.- appPod
abstract Pod? appPod()
The pod that contains the initial
AppModule
.- getClientAsset
abstract ClientAsset? getClientAsset(Uri localUrl, Bool checked := true)
Returns a
ClientAsset
for the given local URL. Throws an Err ifchecked
and a ClientAsset could not be produced.- host
abstract Uri host()
The public facing domain (including scheme & port) used to create absolute URLs.
If set, this is taken from the BedSheetConfigIds.host config value.
If not, then an attempt is made to get this from the HTTP request via the following (in order):
- The
Forwarded
HTTP header - see RFC 7239 - The
X-Forwarded-XXXX
HTTP headers - The
host
HTTP header
See HttpRequest.host for details.
If all fails then
http://localhost:${port}/
is returned.Example:
bedSheetServer.host()
// --> http://www.fantomfactory.org/- The
- modulePods
abstract Pod[] modulePods()
Returns a unique list of pods that contain modules loaded by this BedSheet's IoC.
Useful for gaining a list of pods used in an application, should you wish to scan for classes.
- moduleTypes
abstract Type[] moduleTypes()
Returns a list of modules loaded by this BedSheet's IoC
- options
The Registry options BedSheet was started with.
- path
abstract Uri path()
The request path to this BedSheet
WebMod
. Only really relevant should BedSheet be started in a RouteMod.Starts and ends with a
/
. Example,`/pub/`
Returns
`/`
should BedSheet be the rootWebMod
(the usual case).@see web::WebReq.modBase
- port
abstract Int port()
The port BedSheet is listening to.
- toAbsoluteUrl
abstract Uri toAbsoluteUrl(Uri clientUrl)
Creates an absolute URL for public use; including scheme and authority (host). The given
clientUrl
should be relative to the host and start with a/
.The scheme and authority in the generated URL are taken from the
host()
method.- toClientUrl
abstract Uri toClientUrl(Uri localUrl)
Prepends any extra
WebMod
path info to the given URL so it may be used by clients and browsers. The givenWebMod
local URL should be relative to the BedSheetWebMod
and may, or may not, start with a/
.