The Directive is a declarative file that allows you to describe your application's business logic. By describing your application declaratively, you can avoid all of the boilerplate code that normally comes with building a web service such as binding to ports, setting up TLS, constructing a router, etc.
Here's an example Directive:
identifier: com.suborbital.guideappVersion: v0.0.1atmoVersion: v0.0.6handlers:- type: requestresource: /hellomethod: POSTsteps:- group:- fn: modify-url- fn: helloworld-rs- fn: fetch- type: requestresource: /set/:keymethod: POSTsteps:- fn: cache-set- type: requestresource: /get/:keymethod: GETsteps:- fn: cache-get
This directive encapsulates all of the logic for your application. It describes three endpoints and the logic needed to handle them. Each handler describes a set of steps
that composes a series of Runnables to handle the request.
Atmo uses the Directive to build your application and run it automatically, without any need to write boilerplate yourself.