Skip to content

Latest commit

 

History

History
132 lines (97 loc) · 1.78 KB

Types.md

File metadata and controls

132 lines (97 loc) · 1.78 KB

Module Node.Express.Types

EXPRESS

data EXPRESS :: !

ExpressM

type ExpressM e a = Eff (express :: EXPRESS | e) a

General monad, indicates that we're dealing with express.js related functions. Applications should use HandlerM and AppM primarily and ExpressM in rare cases.

Application

data Application :: *

Event

data Event :: *

Response

data Response :: *

Request

data Request :: *

Protocol

data Protocol
  = Http
  | Https
Instances
instance showProtocol :: Show Protocol
instance isForeignProtocol :: IsForeign Protocol

Method

data Method
  = ALL
  | GET
  | POST
  | PUT
  | DELETE
  | OPTIONS
  | HEAD
  | TRACE
  | CustomMethod String
Instances
instance showMethod :: Show Method
instance isForeignMethod :: IsForeign Method

Port

type Port = Int

Path

type Path = String

RoutePattern

class RoutePattern a
Instances
instance routePath :: RoutePattern String
instance routeRegex :: RoutePattern Regex

RequestParam

class RequestParam a
Instances
instance requestParamString :: RequestParam String
instance requestParamNumber :: RequestParam Number

CookieOptions

newtype CookieOptions
  = CookieOptions { maxAge :: Int, signed :: Boolean, path :: String }

Cookie options

  • maxAge -- time in msecs
  • signed -- use secret to sign if true
  • path -- cookie path
Instances
instance defaultCookieOptions :: Default CookieOptions