Skip to content

A set of REST endpoints for integration with ReqRes.in using http4s, doobie and PostgreSQL

Notifications You must be signed in to change notification settings

ivankliuk/crudser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRUDser

A set of REST endpoints for integration with ReqRes.in using http4s, doobie and PostgreSQL.

Endpoint list

  1. Endpoint that allows to get a user data from ReqRes.in (example: https://reqres.in/api/users/12) and persist user's id, first_name, last_name to the local database. An extra parameter email is used as a unique key for the user table.

POST /users

{
  "email": <string>,
  "user_id": <int>
}

where

  • email - unique key for user identification in the local database
  • user_id - user identifier in ReqRes.in
  1. Endpoint that allows to get a user data from the database.

GET /users/{email}

{
  "email": <string>,
  "id": <int>,
  "first_name": <string>,
  "last_name": <string>
}
  1. Endpoint that allows to delete a user data from the local database.

DELETE /users/{email}

  1. All errors should have following format:
{ "message": <string> }

Running

To run the application:

sbt run

It will be listening on port 8080 by default. All settings are located in src/main/resources/application.conf. Don't forget to configure access to a PostgreSQL instance.

E2E testing

To run end-to-end tests execute e2e-tests.sh script.

About

A set of REST endpoints for integration with ReqRes.in using http4s, doobie and PostgreSQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published