Integrate servant-routes
Fixes #350 (closed).
This MR integrate servant-routes
into Gargantext, with a new CLI option routes
that can be called this way:
cabal v2-run -- gargantext-cli routes list
This will list all the available routes in the system:
GET /swagger.json
GET /swagger-ui
GET /swagger-ui/index.html
POST /api/v1.0/auth
POST /api/v1.0/forgot-password
GET /api/v1.0/forgot-password?uuid=<Maybe Text>
POST /api/v1.0/async/forgot-password/nobody
POST /api/v1.0/async/forgot-password
POST /api/v1.0/async/forgot-password/<ID 'Unsafe "job">/kill?limit=<Maybe Limit>&offset=<Maybe Offset>
GET /api/v1.0/async/forgot-password/<ID 'Unsafe "job">/poll?limit=<Maybe Limit>&offset=<Maybe Offset>
GET /api/v1.0/async/forgot-password/<ID 'Unsafe "job">/wait
GET /api/v1.0/version
GET /api/v1.0/user
PUT /api/v1.0/user
... the list goes on
As well as exporting the whole routes via JSON:
cabal v2-run -- gargantext-cli routes export --file routes.json
The latter is the most useful command, because it can be inserted into a golden test that ensures that future refactoring won't break our routes.