Skip to content

devatherock/velocity-template-tester

Repository files navigation

CircleCI Version Coverage Status Quality Gate Lines of Code Docker Image Size

velocity-template-tester

UI/API for testing Apache Velocity templates

API Reference

Refer the swagger spec or the swagger UI

Key parameters:

  • Endpoint: https://velocity-template-tester.onrender.com/api/expandTemplate
  • Request Content-Type: application/json, application/x-yaml
  • Response Content-Type: text/plain

Sample JSON Payload:

{
  "template": "Hello ${user}",
  "parameters": {
    "name": "John Doe"
  }
}

Sample YAML Payload:

template: Hello ${user}
parameters:
  name: John Doe

Usage

Sample command

docker run --rm \
  -p 8080:8080 \
  devatherock/velocity-template-tester:1.0.0

Troubleshooting

Enabling debug logs

  • Set the environment variable LOGGER_LEVELS_ROOT to DEBUG to enable all debug logs - custom and framework
  • Set the environment variable LOGGER_LEVELS_IO_GITHUB_DEVATHEROCK to DEBUG to enable debug logs only in custom code
  • For fine-grained logging control, supply a custom logback.xml file and set the environment variable JAVA_OPTS to -Dlogback.configurationFile=/path/to/custom/logback.xml

JSON logs

To output logs as JSON, set the environment variable JAVA_OPTS to -Dlogback.configurationFile=logback-json.xml. Refer logstash-logback-encoder documentation to customize the field names and formats in the log