Popularity
3.1
Declining
Activity
0.0
Stable
11
1
0

Monthly Downloads: 29
Programming language: Haskell
License: MIT License
Tags: Web     Servant    

servant-options alternatives and similar packages

Based on the "servant" category.
Alternatively, view servant-options alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of servant-options or a related project?

Add another 'servant' Package

README

Servant-Options

This library provides a middleware that returns HTTP OPTIONS responses for valid application routes defined by your (Proxy :: Proxy api). It is especially useful when trying to write an API that can be used in a cross-origin capacity, as browsers will send "pre-flight" checks by requesting OPTIONS for routes that are about to be called.

Before:

After:

Usage:

module MyApp where

import App
import Servant
import Network.Wai.Middleware.Cors
import Network.Wai.Middleware.Servant.Options

app :: Application
app = logStdoutDev
    $ cors (const $ Just policy)
    $ provideOptions apiProxy
    $ serve apiProxy apiServer
  where
  policy = simpleCorsResourcePolicy
           { corsRequestHeaders = [ "content-type" ] }

See Also