Skip to content

grouch-trash-service/grouch-api-gateway

Repository files navigation

Grouch api gateway

Grouch api gateway is the api gateway for Grouch Trash Service. The api for grouch trash service is defined using open api and runs on aws API Gateway. For full documentation on the api please see the swagger-ui page.

Build

The project is build using maven and uses npm and sam.

The following command can be used to build.

./mvnw package

Running locally

The api can be started locally with sam by running the following command.

sam build -t template-local.yaml && sam local start-api

to run swagger-ui locally run the following command

docker run -p 8080:8080 -e SWAGGER_JSON=/schema/api.yaml -v `pwd`/src/main/resources:/schema swaggerapi/swagger-ui

Tests

Cucumber Tests

This project uses cucumber to automate testing and describe behavior. To run the tests locally first start the api. Then run the following command.

./mvnw -P cucumber verify

To run the same tests against the production api.

./mvnw -P cucumber verify -Dspring.profiles.active=prod -DgrouchTrashMessageService.security.authorizer.key=${API_KEY}

Packages

packages that contains generated client code will be deployed to github as part of the build pipeline. To deploy these packages locally first set the following env variables.

  • GITHUB_ACTOR
  • GITHUB_TOKEN
  • NODE_AUTH_TOKEN

Then run the following command.

./mvnw -s settings.xml deploy

Deploy

The code will automatically be built and deployed with a github action.

to deploy the application first use the aws configure comand to setup credentials for aws, then run

sam deploy

To deploy swagger-ui to the aws s3 run the following.

Deploy openapi schema to S3

aws s3 cp src/main/resources/api.yaml s3://grouch-message-service-swagger

Deploy swagger-ui to S3

aws s3 sync node_modules/swagger-ui-dist s3://grouch-message-service-swagger-ui

About

API Gateway for the grouch trash services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages