yapp

A framework for apps written entirely in YAML, powered by ytt.

Highly experimental! Do not use!

# start the server...
go run . -f examples/hello-world/yapp.yml
# and then...
curl localhost:7000/hello -d '{"name": "reid"}'

how it works

You configure your app’s routes in a yapp.yml file. You can use ytt to template this file! And for POST requests, the request body will be parsed as YAML and passed to the template as data values under data.values.request.

examples

A simple yapp is just a YAML file like this:

routes:
  GET /hello:
    status: 200
    body:
      message: "hello!"

Run it with go run . -f path/to/yapp.yml, and then curl localhost:7000/hello:

$ curl localhost:7000/hello
message: hello!

But that’s just plain YAML. It gets really fun when you start using ytt!

#@ load("@ytt:data", "data")
---
routes:
  POST /hello:
    status: 200
    body:
      message: "hello!"
      name: #@ data.values.request.name

Run it with go run . -f path/to/yapp.yml, and then curl localhost:7000/hello -d '{"name": "reid"}':

$ curl localhost:7000/hello -d '{"name": "reid"}'
message: hello!
name: reid

See examples directory for more!

GitHub

View Github