https://github.com/sollimann/kotlin-spring-boot
A RESTful API with Spring Boot and Maven in Kotlin.
https://github.com/sollimann/kotlin-spring-boot
Last synced: 27 days ago
JSON representation
A RESTful API with Spring Boot and Maven in Kotlin.
- Host: GitHub
- URL: https://github.com/sollimann/kotlin-spring-boot
- Owner: Sollimann
- Created: 2020-05-06T10:51:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T10:55:51.000Z (over 5 years ago)
- Last Synced: 2025-06-19T06:09:47.004Z (4 months ago)
- Language: Kotlin
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
### Run the API
type the following in the root directory of the application and Sptring Boot will startup. After that you can interact with the API in another terminal.
```bash
$ mvn spring-boot:run
```### adds a new customer
```bash
$ curl -H "Content-Type: application/json" -X POST -d '{
"firstName": "Kristoffer",
"lastName": "Solberg"
}' http://localhost:8080/customers
```### retrieves all customers
```bash
$ curl http://localhost:8080/customers
```### updates customer with id 1
```bash
$ curl -H "Content-Type: application/json" -X PUT -d '{
"id": 1,
"firstName": "Kristoffer",
"lastName": "Rakstad"
}' http://localhost:8080/customers/1
```### deletes customer with id 1
```bash
$ curl -X DELETE http://localhost:8080/customers/1
```