Skip to content

jamesward/spring-kotlin-postgres

Repository files navigation

Spring Kotlin Postgres

Local Dev

Start the server:

./gradlew bootRun

Use the server:

# Create a "bar"
curl -v -X POST localhost:8080/bars -H 'Content-Type: application/json' -d '{"name": "Test"}'

# Get the "bars"
curl localhost:8080/bars

Run the tests:

./gradlew test

Create container & run with docker:

./gradlew bootBuildImage

docker run --rm -ePOSTGRES_PASSWORD=password -p5432:5432 --name my-postgres postgres:13.3

docker run -it --network host \
  -eSPRING_R2DBC_URL=r2dbc:postgresql://localhost/postgres \
  -eSPRING_R2DBC_USERNAME=postgres \
  -eSPRING_R2DBC_PASSWORD=password \
  spring-kotlin-postgres \
  init \
  --spring.main.web-application-type=none

# psql
docker exec -it my-postgres psql -U postgres

docker run -it --network host \
  -eSPRING_R2DBC_URL=r2dbc:postgresql://localhost/postgres \
  -eSPRING_R2DBC_USERNAME=postgres \
  -eSPRING_R2DBC_PASSWORD=password \
  spring-kotlin-postgres

http://localhost:8080/bars

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages