Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 1.59 KB

File metadata and controls

19 lines (14 loc) · 1.59 KB

contacts-backend-app

Contains a backend app that exposes a controller to get, add and delete Contacts.

The Contacts are stored in memory.

How to compile & run?

  1. You'll need to compile contacts-common-lib first, as explained here.
  2. Open the project in your favorite IDE and run the main function from Application.kt.

You can now perform GET, POST and DELETE requests to /api/contacts. E.g:

Request cURL Screenshot
Get curl localhost:8080/api/contacts/1 Contacts - Server - Get
Get all curl localhost:8080/api/contacts Contacts - Server - Get all
Post curl -X POST -H "Content-Type: application/json" -d '{"id": "3", "name": "Mario", "number":"1234-5678"}' localhost:8080/api/contacts Contacts - Server - Post
Delete curl -X DELETE localhost:8080/api/contacts/3 -v Contacts - Server - Delete

Note: You must start this application so that the Android, iOS and backend clients using contacts-client-lib will be able to make HTTP requests.