ckmohan / micronaut-live-newsletter

Newsletter Micronaut application coded during Micronaut Live

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local Development

The application needs a PostgreSQL database. The easiest way is to run aa PostgreSQL database via Docker with:

$ docker run -it --rm -p 5432:5432 -e POSTGRES_USER=dbuser -e POSTGRES_PASSWORD=theSecretPassword -e POSTGRES_DB=postgres postgres:11.5-alpine

Create a file under app/src/main/resources/application-dev.yml with following content:

datasources:
  default:
    url: jdbc:postgresql://localhost:5432/postgres
    driverClassName: org.postgresql.Driver
    schema-generate: NONE
    dialect: POSTGRES
    username: dbuser
    password: theSecretPassword

Run the application

./gradlew :app:run

Artifacts

FAT JAR

./gradlew :app:build. You can find the fat jar under app/build/libs/app-0.1-all.jar

Optimized FAT JAR

./gradlew :app:optimizedJitJarAll. You can find the fat jar under app/build/libs/app-0.1-all-optimized.jar

Native Image

./gradlew :app:nativeCompile. You can find the native image under app/build/native/nativeCompile/app

Optimized Native Image

./gradlew :app:nativeOptimizedCompile. You can find the native image under ./app/build/native/nativeOptimizedCompile/app `

Artifact tests

In one terminal, generate and run the native image or fat jar (see previous sections).

In another terminal, export the environment variable APP_URL to the native image url and run the test-native tests:

export APP_URL=http://localhost:8080
./gradlew test-native:test

Micronaut 3.1.1 Documentation


Feature http-client documentation

About

Newsletter Micronaut application coded during Micronaut Live


Languages

Language:Java 56.3%Language:Groovy 33.4%Language:HTML 10.3%