Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hienduyph/vertx-kotlin-coroutines
Vertx Kotlin Coroutine Example
https://github.com/hienduyph/vertx-kotlin-coroutines
asyncio kotlin kotlin-coroutines vertx
Last synced: 19 days ago
JSON representation
Vertx Kotlin Coroutine Example
- Host: GitHub
- URL: https://github.com/hienduyph/vertx-kotlin-coroutines
- Owner: hienduyph
- Created: 2022-05-31T02:59:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-31T02:59:16.000Z (over 2 years ago)
- Last Synced: 2024-11-01T02:23:36.164Z (2 months ago)
- Topics: asyncio, kotlin, kotlin-coroutines, vertx
- Language: Kotlin
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vertx Kotlin Coroutine Example
## Get started
**Run database first**```sql
podman run --name postgres -d -p 5432:5432 -e POSTGRES_PASSWORD=root -e POSTGRES_DB=blog docker.io/postgres:14
```
**Init the database**```sql
CREATE EXTENSION "pgcrypto";CREATE TABLE blog.posts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
title VARCHAR(255),
content text,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
**Run the server**
```bash
./gradlew run
``````bash
curl -X POST -H "content-type:application/json" -d '{"title": "This is next post", "content": "Hello world from sample post"}' 'http://localhost:8888/posts'
curl 'http://localhost:8888/posts'
```