This repository contains the source code for a new microservice. You may use this source code for creating a new microservice which automatically registers at the api gateway and sets up a route on the gateway if needed.
DO NOT FORK THIS REPOSITORY SINCE THE COMMIT HISTORY WILL BE TRANSFERRED INTO THE NEW REPOSITORY
- Install Golang on your development machine if not already installed
- Download the repository as archive to your development machine
- Create a new empty repository for your new service
- Decompress the downloaded archive into the empty repository
- You may now make your initial commit in the repository
- Look for all TODOs in the files and act according to the TODOs
- Enjoy writing your own microservice
The microservice template is configurable via the following environment variables:
CONFIG_LOGGING_LEVEL
→ Set the logging verbosity [optional, defaultINFO
]CONFIG_API_GATEWAY_HOST
→ Set the host on which the API Gateway runs on [required]CONFIG_API_GATEWAY_ADMIN_PORT
→ Set the port on which the API Gateway listens on [required]CONFIG_API_GATEWAY_SERVICE_PATH
→ Set the path under which the service shall be reachable. Do not prepend the path with/api
. Only set the last part of the desired path [required]CONFIG_HTTP_LISTEN_PORT
→ The port on which the built-in webserver will listen on [optional, default8000
]CONFIG_SCOPE_FILE_PATH
→ The location where the scope definition file is stored [optional, default `/microservice/res/scope.json]