https://github.com/retheviper/ktorsample
A simple sample of Ktor.
https://github.com/retheviper/ktorsample
gradle kotlin ktor rest-api
Last synced: about 2 months ago
JSON representation
A simple sample of Ktor.
- Host: GitHub
- URL: https://github.com/retheviper/ktorsample
- Owner: retheviper
- Created: 2021-07-11T12:11:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-30T12:41:05.000Z (about 4 years ago)
- Last Synced: 2025-04-13T08:56:15.414Z (about 1 year ago)
- Topics: gradle, kotlin, ktor, rest-api
- Language: Kotlin
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ktor Sample
## TL;DR
A simple sample of Rest API by [Ktor](https://ktor.io).
This is another implementation version of [Spring Boot Sample](https://github.com/retheviper/springbootsample).
In Construction!
## Includes
- [Gradle](https://gradle.org) (Kotlin DSL)
- [Exposed](https://github.com/JetBrains/Exposed)
- [Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization)
- [Kotest](https://kotest.io)
## Architecture
- `application`: router/handler functions, data models (request/response), configurations
- `common`: common utils, constants
- `domain`: dtos
- `infrastructure`: repositories, tables
- `plugins`: plugins and settings for db, routing, security, serialization
## Test APIs
1. Run server.
```shell
./gradlew run
```
2. Import [Postman](https://www.postman.com) data from below.
```shell
/miscs/SpringBootSample.postman_collection.json
```
3. Test with Postman.
Note: Some APIs need JWT on HTTP Request Header(`Authorization: Bearer xxx`) and it will be found at HTTP Response Header when successfully logged in.