Module

Node.Express.App

#AppM

newtype AppM a

Monad responsible for application related operations (initial setup mostly).

Constructors

Instances

#App

type App = AppM Unit

#HandlerFn

#listenHttp

listenHttp :: App -> Port -> (Event -> Effect Unit) -> Effect Server

Run application on specified port and execute callback after launch. HTTP version

#listenHttps

listenHttps :: forall opts. App -> Port -> opts -> (Event -> Effect Unit) -> Effect Server

Run application on specified port and execute callback after launch. HTTPS version

#listenHostHttp

listenHostHttp :: App -> Port -> Host -> (Event -> Effect Unit) -> Effect Server

Run application on specified port & host and execute callback after launch. HTTP version

#listenHostHttps

listenHostHttps :: forall opts. App -> Port -> Host -> opts -> (Event -> Effect Unit) -> Effect Server

Run application on specified port & host and execute callback after launch. HTTPS version

#listenPipe

listenPipe :: App -> Pipe -> (Event -> Effect Unit) -> Effect Server

Run application on specified named pipe and execute callback after launch. HTTP version

#makeHttpServer

makeHttpServer :: App -> Effect Server

Create a Node.HTTP server from the Express application. HTTP version

#makeHttpsServer

makeHttpsServer :: App -> Effect Server

Create a Node.HTTP server from the Express application. HTTPS version

#apply

apply :: App -> Application -> Effect Unit

Apply App actions to existent Express.js application

#use

use :: Handler -> App

Use specified middleware handler.

#useExternal

useExternal :: Middleware -> App

Use any function as middleware. Introduced to ease usage of a bunch of external middleware written for express.js. See http://expressjs.com/4x/api.html#middleware

#useAt

useAt :: Path -> Handler -> App

Use specified middleware only on requests matching path.

#useAtExternal

useAtExternal :: Path -> Middleware -> App

Use any function as middleware only on requests matching path. Introduced to ease usage of a bunch of external middleware written for express.js. See http://expressjs.com/4x/api.html#middleware

#useOnParam

useOnParam :: String -> (String -> Handler) -> App

Process route param with specified handler.

#useOnError

useOnError :: (Error -> Handler) -> App

Use error handler. Probably this should be the last middleware to attach.

#getProp

getProp :: forall a. String -> AppM (Maybe a)

Get application property. See http://expressjs.com/4x/api.html#app-settings

#setProp

setProp :: forall a. String -> a -> App

Set application property. See http://expressjs.com/4x/api.html#app-settings

#http

http :: forall r. RoutePattern r => Method -> r -> Handler -> App

Bind specified handler to handle request matching route and method.

#get

get :: forall r. RoutePattern r => r -> Handler -> App

Shortcut for http GET.

#post

post :: forall r. RoutePattern r => r -> Handler -> App

Shortcut for http POST.

#put

put :: forall r. RoutePattern r => r -> Handler -> App

Shortcut for http PUT.

#delete

delete :: forall r. RoutePattern r => r -> Handler -> App

Shortcut for http DELETE.

#all

all :: forall r. RoutePattern r => r -> Handler -> App

Shortcut for http ALL (match on any http method).

#_getProp

_getProp :: forall a. Fn4 Application String (Maybe a) (a -> Maybe a) (Effect (Maybe a))

#_setProp

#_listenHttp

#_listenHttps

_listenHttps :: forall opts. Application -> Int -> opts -> (Event -> Effect Unit) -> Effect Server

#_listenHostHttp

#_listenHostHttps

_listenHostHttps :: forall opts. Application -> Int -> String -> opts -> (Event -> Effect Unit) -> Effect Server

Modules