= Team Fastlane Base Service
A service base for a ruby micro service
== Installation
As described by the link:../README.adoc[main readme].
== Usage
=== Health Check
You can use the link:../bin/health_check[health_check] executable to provide a method of checking the health of the server (database included).
For example within a docker file like this:
[source, Dockerfile]
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD [ "bundle", "exec", "health_check" ]
This makes use of an exposed endpoint called /health_check
, which you can only use for a custom ping to check for it.
=== Performance Logging
There is an easy to use performance logging (please only use in development) included. Simply add with_measure
around the block you want to measure.
The result will be added to the rails time stamp log output.
=== Default responses
This also provides some default json responses to be used in your controller. See link:./app/controllers/concerns/responses.rb[responses.rb] for more details.
To use these responses let your ApplicationController
inherit from ApiBaseController
and you are set.
=== Parameter handling
You get automatically camelCase to snake_case transformation for the request and the reverse for responses via the olive_branch gem.
There will be a default parameter filtering enabled. It filters passwords of various key names in development and everything in production.