Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipelining #4

Open
tdammers opened this issue Jun 8, 2018 · 0 comments
Open

Pipelining #4

tdammers opened this issue Jun 8, 2018 · 0 comments

Comments

@tdammers
Copy link
Owner

tdammers commented Jun 8, 2018

Something I've wanted for a while now was the ability to "pipeline" rules, that is, build rules by chaining multiple rules together. After all, the data coming out of data sources in a rule are of the same kind of shape as what ultimately gets served.

Turns out there is a blatantly simple solution to this: Just make a new backend type that fetches data from a rule, sort of like an internal subrequest. Something like:

rules:
  - pattern: '/foobar/json/{{item:*}}'
    data:
    - thing: 'file://./data/{{item}}'
    template: 'item.json'
    content-type: 'application/json'
  - pattern: '/foobar/html/{{item:*}}'
    data:
    - thing: 'self:///foobar/json/{{item}}'
    template: 'item.html'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant