A framework for apps written entirely in YAML, powered by ytt.
Highly experimental! This is a ridiculous idea! Do not use!
# build & start the server...
make build
./yapp examples/hello-world/yapp.yml
# and then...
curl localhost:7000/hello -d '{"name": "reid"}'You configure your app's routes in a yapp.yml file. You can use ytt to template this file!
Details about incoming HTTP requests will be passed to the template as data values under data.values.request.
These are the values that are currently provided to your template:
data.values.request.body: request body, parsed as YAMLdata.values.request.headers: request headers (map[string]string[])data.values.request.query: request query parameters (map[string]string[])
A simple yapp is just a YAML file like this:
routes:
GET /hello:
status: 200
body:
message: "hello!"Run with yapp and try 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.body.nameRun with yapp and try curl localhost:7000/hello -d '{"name": "reid"}':
$ curl localhost:7000/hello -d '{"name": "reid"}'
message: hello!
name: reidSee the examples directory for more!