e2core icon indicating copy to clipboard operation
e2core copied to clipboard

`file` step type in Directive handlers

Open cohix opened this issue 4 years ago • 0 comments

I think the ideal here is that in the directive you’d be able to have a file step (in addition to the existing fn and group) that lazy-loads a file, that way you could have a handler that looks like this:

handlers:
    type: request
    resource: /file/:something
    steps:
        - file: /var/html/:something

And if you DID have fn types afterwards, it could access the file contents using the state API, and the file would be read at the time of use.

The time of use could either be when accessed by a Runnable or when the handler returns and the file step is the thing being returned.

cohix avatar Jan 12 '22 23:01 cohix