Generates a Swagger spec from a Servant API.
This program will
- Start a warp server on port 8081
- Initialize a SQLite database file at
./db.sqlite
- Populate the SQLite database (see Main.hs)
- Serve the Snails REST API
- Generate Swagger docs
Use Swagger Editor to view swagger.json
.
This project was built with Servant + Persistent.
If you do not have cabal
, I highly recommend ghcup
or
reading this manual.
# Clone this repo
git clone https://github.com/ldgrp/snails-api
# Navigate to project directory
cd snails-api
# Start the server
cabal run
- Clone this repo
git clone https://github.com/ldgrp/snails-api
- Edit the files in
src/
. - Run the main executable with
cabal run
in the main directory. This will generate aswagger.json
.
- Authentication
- Handle JWT tokens. For protected endpoints, the server will currently accept the user id as a "token".
- User API
- Entry API
- Messaging API
- (Mock) Map API
- (Mock) News API
- (Mock) Transport API
- (Mock) Weather API
- Use esqueleto. Persistent does not support SQL joins 😞
- Postgres support
- Tests