postgrest- REST API for any Postgres database

Safe HaskellNone



This module provides a helper function to read the command line arguments using the optparse-applicative and the AppConfig type to store them. It also can be used to define other middleware configuration that may be delegated to some sort of external configuration.

It currently includes a hardcoded CORS policy but this could easly be turned in configurable behaviour if needed.

Other hardcoded options such as the minimum version number also belong here.



prettyVersion :: String Source #

User friendly version number

readOptions :: IO AppConfig Source #

Function to read and parse options from the command line

corsPolicy :: Request -> Maybe CorsResourcePolicy Source #

CORS policy to be used in by Wai Cors middleware

minimumPgVersion :: Integer Source #

Tells the minimum PostgreSQL version required by this version of PostgREST

data AppConfig Source #

Data type to store all command line options