Skip to content

Small HTTP web server with a simple backend, implemented using typelevel libraries (cats, http4s, doobie, circe, etc.) and packaged via docker-compose.

Notifications You must be signed in to change notification settings

slouc/typelevel-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typelevel stack backend

This project contains a small skeleton of a simple web server. It provides a schoolbook way of building a simple backend from basic parts, mostly coming from the typelevel stack.

Libraries:

SBT plugins:

It uses docker-compose to pack the server together with a PostgreSQL database. This is useful for running the server locally.

Server defines two endpoints:

  • GET /users/[UUID] for fetching users from the database
  • POST /users for adding users to the database

First spin up docker and populate the database, then run the server:

> docker-compose up &
> sbt
sbt:typelevelstack> flywayMigrate
sbt:typelevelstack> run 

You can try out the server by issuing

> curl localhost:8080/users/f33f4247-938b-49cc-b8f7-a01d138ff26f
> curl -X POST localhost:8080/users  --data '{"email":"xyz@gmail.com"}'

About

Small HTTP web server with a simple backend, implemented using typelevel libraries (cats, http4s, doobie, circe, etc.) and packaged via docker-compose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages