Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

HttpListenerHelper

Contains basic HTTP listener functions for FAKE.Deploy.

Nested types and modules

TypeDescription
HttpResponseMessage<'a>
Listener

Represents a http listener.

Route

Represents a route.

RouteResult

Represents a route result.

Functions and values

Function or valueDescription
canListen(port)
Signature: port:string -> bool

Returns if the http listener can listen to the given port.

createRoutes(routes)
Signature: routes:seq<string * string * (Map<string,string> -> HttpListenerContext -> string)> -> seq<(string -> string -> RouteResult option)>

Creates routes for the http listener.

defaultRoutes
Signature: (string * string * ('?7866 -> HttpListenerContext -> string)) list
Type parameters: '?7866

Contains the default routes.

emptyListener
Signature: Listener

Creates an empty http listener.

ensureCanBindHttpPort(port)
Signature: port:string -> unit

Checks whether the http listener can be bound to the given port.

getFirstFreePort()
Signature: unit -> string

Returns the first free port which can be used for the http listener.

getPort(configPort)
Signature: configPort:string -> string

Returns the specified port from the config or the first free port if no port was specified.

matchRoute routes verb url
Signature: routes:seq<Route> -> verb:string -> url:string -> RouteResult option

Matches an URL with the given routes.

start log serverName port requestMap
Signature: log:(string * EventLogEntryType -> unit) -> serverName:string -> port:string -> requestMap:seq<(string -> string -> RouteResult option)> -> Listener

Starts a http listener on the given server and port.

startWithConsoleLogger(...)
Signature: serverName:string -> port:string -> requestMap:seq<(string -> string -> RouteResult option)> -> Listener

Starts a http listener on the given server and port - uses the console logger.