Popularity
3.1
Declining
Activity
0.0
Stable
11
1
0
Monthly Downloads: 28
Programming language: Haskell
License: MIT License
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.
-
servant
Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more! -
servant-generate
Generate default implementations for servers in a flexible way (a.k.a servant-mock on steroids)
WorkOS - The modern identity platform for B2B SaaS
The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Promo
workos.com
Do you think we are missing an alternative of servant-options or a related project?
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" ] }