Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
6d58acdd
Commit
6d58acdd
authored
Feb 03, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][CLEAN] cosmetics.
parent
ad22b372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
API.hs
src/Gargantext/API.hs
+8
-12
No files found.
src/Gargantext/API.hs
View file @
6d58acdd
...
...
@@ -21,7 +21,8 @@ The Garg-API-Monad enables:
- In Memory stack management (short term)
- Logs (WIP)
Thanks to @yannEsposito (at the start) and @np (after).
Thanks to Yann Esposito for our discussions at the start and to Nicolas
Pouillard (who mainly made it).
-}
...
...
@@ -315,9 +316,11 @@ type GargPrivateAPI' =
-- :<|> "ngrams" :> Capture "node_id" Int :> NodeAPI
-- :<|> "auth" :> Capture "node_id" Int :> NodeAPI
---------------------------------------------------------------------
type
SwaggerFrontAPI
=
SwaggerAPI
:<|>
FrontEndAPI
type
API
=
SwaggerFrontAPI
:<|>
GargAPI
:<|>
Get
'[
H
TML
]
Html
type
API
=
SwaggerAPI
:<|>
FrontEndAPI
:<|>
GargAPI
:<|>
Get
'[
H
TML
]
Html
-- This is the concrete monad. It needs to be used as little as possible,
-- instead, prefer GargServer, GargServerT, GargServerC.
...
...
@@ -336,7 +339,8 @@ type EnvC env =
server
::
forall
env
.
EnvC
env
=>
env
->
IO
(
Server
API
)
server
env
=
do
-- orchestrator <- scrapyOrchestrator env
pure
$
swaggerFront
pure
$
schemaUiServer
swaggerDoc
:<|>
frontEndServer
:<|>
hoistServerWithContext
(
Proxy
::
Proxy
GargAPI
)
(
Proxy
::
Proxy
AuthContext
)
transform
serverGargAPI
:<|>
serverStatic
where
...
...
@@ -420,13 +424,8 @@ serverStatic = $(do
)
---------------------------------------------------------------------
swaggerFront
::
Server
SwaggerFrontAPI
swaggerFront
=
schemaUiServer
swaggerDoc
:<|>
frontEndServer
--gargMock :: Server GargAPI
--gargMock = mock apiGarg Proxy
---------------------------------------------------------------------
makeApp
::
EnvC
env
=>
env
->
IO
Application
makeApp
env
=
serveWithContext
api
cfg
<$>
server
env
...
...
@@ -439,7 +438,6 @@ makeApp env = serveWithContext api cfg <$> server env
--appMock :: Application
--appMock = serve api (swaggerFront :<|> gargMock :<|> serverStatic)
---------------------------------------------------------------------
api
::
Proxy
API
api
=
Proxy
...
...
@@ -447,12 +445,10 @@ api = Proxy
apiGarg
::
Proxy
GargAPI
apiGarg
=
Proxy
---------------------------------------------------------------------
schemaUiServer
::
(
Server
api
~
Handler
Swagger
)
=>
Swagger
->
Server
(
SwaggerSchemaUI'
dir
api
)
schemaUiServer
=
swaggerSchemaUIServer
-- Type Family for the Documentation
type
family
TypeName
(
x
::
*
)
::
Symbol
where
TypeName
Int
=
"Int"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment