const mixinafBedSheet::BedSheetServer

afBedSheet::BedSheetServer

(Service) - Information about the BedSheet server.

appModule

Source

abstract Type? appModule()

The AppModule.

appName

Source

abstract Str appName()

Returns pod.dis (or proj.nameif not found) from the application's pod meta, or the pod name if neither are defined.

appPod

Source

abstract Pod? appPod()

The pod that contains the initial AppModule.

getClientAsset

Source

abstract ClientAsset? getClientAsset(Uri localUrl, Bool checked := true)

Returns a ClientAsset for the given local URL. Throws an Err if checked and a ClientAsset could not be produced.

host

Source

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):

  1. The Forwarded HTTP header - see RFC 7239
  2. The X-Forwarded-XXXX HTTP headers
  3. 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/ 
modulePods

Source

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

Source

abstract Type[] moduleTypes()

Returns a list of modules loaded by this BedSheet's IoC

options

Source

abstract Str:Obj options()

The Registry options BedSheet was started with.

path

Source

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 root WebMod (the usual case).

@see web::WebReq.modBase

port

Source

abstract Int port()

The port BedSheet is listening to.

toAbsoluteUrl

Source

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

Source

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 given WebMod local URL should be relative to the BedSheet WebMod and may, or may not, start with a /.