This project was created using the Ktor,and this is a server which supports adding, updating, and removing notes.
It is a very simple project that I'm using to experiment with / learn Ktor.
Setting this up locally is trivial
$ git clone https://github.com/dmc0001/note-backend
cd note-backend
./gradlew run
This backend supports five actions: "create-note", "delete-node", "update-note", "fetch-note", and "list-notes"
curl -X GET http://0.0.0.0:8080/api/v1/notes/list
[
{
"id": 1,
"title": "note 1",
"description": "description note 1"
},
{
"id": 2,
"title": "note 2",
"description": "description note 2"
}
]
- 404
- 405
- 200
curl -X GET "http://0.0.0.0:8080/api/v1/notes/find?id=1"
{
"id": 1,
"title": "note 1",
"description": "description note 1"
}
- 404
- 405
- 200
curl -X POST http://0.0.0.0:8080/api/v1/notes/create -d { "note":{ "id": 2, "title": "note 2","description": "description note 2"}}
{
"note": { "id": 2,
"title": "note 2",
"description": "description note 2"
}
}
- 404
- 405
- 201
curl -X PUT http://0.0.0.0:8080/api/v1/notes/update -d { "note":{"id":2 title": "note 2","description": "description note 2"}}
{
"note": { "id": 2,
"title": "note 2",
"description": "description note 2"
}
}
- 404
- 405
- 200
curl -X DELETE http://0.0.0.0:8080/api/v1/notes/delete -d { "note":{"id":2 title": "note 2","description": "description note 2"}}
{
"note": { "id": 2,
"title": "note 2",
"description": "description note 2"
}
}
- 404
- 405
- 200
Here's a list of features included in this project:
Name | Description |
---|---|
Routing | Provides a structured routing DSL |
Content Negotiation | Provides automatic content conversion according to Content-Type and Accept headers |
kotlinx.serialization | Handles JSON serialization using kotlinx.serialization library |
Static Content | Serves static files from defined locations |