Skip to content

thanhlt-1007/KotlinHello

Repository files navigation

KOTLIN HELLO

1. Development Environment

  • Spring Boot 3.1.2

  • Gradle 8.2.1

  • Java 17.0.7

  • Kotlin 1.7.21

2. Spring Boot Dependencies

a. Web

  • Spring Web

b. SQL

  • Spring Data JDBC

  • H2 Database

c. Dotenv

  • Dotenv Kotlin 6.4.1

3. Getting Started

  • Command
./gradlew bootRun
  • Access
http://localhost:8080

4. Endpoints

a. Web

curl -X GET 'http://localhost:8080?name=John'
curl -X GET 'http://localhost:8080/envs'

b. API

curl -X GET 'http://localhost:8080/api/v1/messages'
curl -X POST 'http://localhost:8080/api/v1/messages' \
-H "Content-Type: application/json" \
--data '{
  "text": "dummy text"
}'
curl -X POST 'http://localhost:8080/api/v1/messages' \
-H "Content-Type: application/json" \
--data '{
  "id": "424a6d52-1c34-4c7d-8c61-680b8c37e72e",
  "text": "upda6te dummy text"
}'
curl -X GET 'http://localhost:8080/api/v1/messages/424a6d52-1c34-4c7d-8c61-680b8c37e72e'