Module

Payload.Server.Handlers

Package
purescript-payload
Repository
hoodunit/purescript-payload

Contains various built-in handlers for e.g. returning static files.

#File Source

data File

Spec type for returning a file with a specific path. Attempts to return an appropriate MIME type, defaulting to "text/plain". Fails with 404 Not Found if file cannot be found.

Constructors

Instances

#directory Source

directory :: forall f. Foldable f => String -> f String -> Aff (Either Failure File)

Handler for returning static files from a directory. Protects against directory traversal attacks.

#file Source

file :: forall r. String -> Record r -> Aff File

Handler for returning a file at the given path.