1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-23 12:52:31 +03:00

Use ReDoc instead of Swagger-UI

This commit is contained in:
Artyom Kazak 2018-09-01 20:25:47 +02:00
parent e75fca62b7
commit 6020688fa3
3 changed files with 7 additions and 4 deletions

View File

@ -142,7 +142,7 @@ library
, servant-generic
, servant-server
, servant-swagger
, servant-swagger-ui
, servant-swagger-ui-redoc
, swagger2
, shortcut-links >= 0.4.2
, slave-thread

View File

@ -16,7 +16,7 @@ import Data.Acid as Acid
import Servant
import Servant.Generic
import Servant.Swagger
import Servant.Swagger.UI
import Servant.Swagger.UI.ReDoc
import Network.Wai.Handler.Warp (run)
import Network.Wai (Middleware)
import Network.Wai.Middleware.Cors (CorsResourcePolicy (..), cors
@ -37,12 +37,12 @@ apiServer db = Site
type FullApi =
Api :<|>
"docs" :> SwaggerSchemaUI "api" "swagger.json"
SwaggerSchemaUI "api" "swagger.json"
fullServer :: DB -> Server FullApi
fullServer db =
toServant (apiServer db) :<|>
swaggerSchemaUIServer (toSwagger (Proxy @Api))
redocSchemaUIServer (toSwagger (Proxy @Api))
-- | Serve the API on port 4400.
--

View File

@ -14,6 +14,9 @@ extra-deps:
- digestive-functors-0.8.4.0
- servant-generic-0.1.0.3
- acid-state-0.14.3
- servant-swagger-ui-redoc-0.3.0.1.21.2
- file-embed-lzma-0
- servant-swagger-ui-core-0.3.1
- git: https://github.com/neongreen/patches-vector
commit: 9bb704cf7f14cff9ef76a5d177e4e56ceee24705
- git: https://github.com/aelve/stache-plus