Skip to content

Instantly share code, notes, and snippets.

View felipewind's full-sized avatar

Felipe Henrique Gross Windmoller felipewind

View GitHub Profile
@felipewind
felipewind / ProductResource.java
Last active March 20, 2024 20:33
Passing JWT token using the swagger-ui
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@felipewind
felipewind / heroku.quarkus.application.properties
Last active July 17, 2021 19:23
heroku-quarkus-angular-docker - Quarkus properties example
# Database
quarkus.datasource.db-kind=postgresql
quarkus.datasource.jdbc.url=${DB_JDBC_URL}
quarkus.datasource.username=${DB_JDBC_USER:postgres}
quarkus.datasource.password=${DB_JDBC_PASSWORD:postgres}
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-orm.sql-load-script=import.sql
# Port
quarkus.http.port=${PORT:8080}
@felipewind
felipewind / heroku.docker-compose.yml
Last active July 19, 2021 21:58
Heroku demo project with Quarkus, PostgreSQL and Angular
version: "3.8"
services:
heroku-postgresql:
container_name: heroku-postgres
image: postgres:13.3
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
@felipewind
felipewind / heroku-extract-database-url-to-quarkus.sh
Created July 18, 2021 16:50
Bash script to extract Quarkus datasource parameters from Heroku DATABASE_URL
#!/bin/sh
# =============================================================================
# This script automatically splits the Heroku ENV DATABASE_URL variable
# into the three JDBC variables needed from Quarkus.
#
# It will only do the split if the DB_HEROKU_SPLIT is set to "true".
#
# If you set DB_HEROKU_SPLIT to 'false', you must pass the Quarkus parameters:
# - DB_JDBC_URL;
# - DB_JDBC_USER;
@felipewind
felipewind / heroku.angular.Dockerfile
Created July 19, 2021 23:00
Heroku Angular/Nginx Dockerfile example
FROM nginx:latest
COPY dist/heroku /usr/share/nginx/html
COPY ./nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
CMD ["/bin/bash", "-c", \
"echo API_URL=[$API_URL], && \
echo PORT=[$PORT], && \
sed -i s#HEROKU_API_URL#$API_URL#g /usr/share/nginx/html/main.*.js && \