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

Allow requests to pass through exec middleware #19

Merged
merged 2 commits into from
Feb 17, 2023
Merged

Allow requests to pass through exec middleware #19

merged 2 commits into from
Feb 17, 2023

Conversation

andrewbrey
Copy link
Contributor

@andrewbrey andrewbrey commented Feb 6, 2023

Rather than always responding to the request with the result of the executed command, it can be desirable to simply run commands as a side-effect of handling a route in a given middleware chain. This enables use cases such as:

  • regeneration of static assets just before serving them
  • (re)starting proxy servers just prior to sending them a request
  • alerting when certain routes are accessed
  • etc

Note that the configuration name "pass_thru" was chosen to mirror the analogous configuration found in the file_server module: https://caddyserver.com/docs/caddyfile/directives/file_server#pass_thru

Implements #15

@andrewbrey andrewbrey changed the title feat: allow requests to pass through exec middleware Allow requests to pass through exec middleware Feb 6, 2023
@andrewbrey andrewbrey closed this Feb 17, 2023
@andrewbrey andrewbrey reopened this Feb 17, 2023
@andrewbrey
Copy link
Contributor Author

@abiosoft I've updated this PR to include the changes you just merged in from #17 - sorry for any notification spam that was generated by GitHub, I tried to resolve the conflicting files in the UI, but that was more trouble than it was worth and had to re-fix from command line 😬

@abiosoft abiosoft merged commit 46a1d88 into abiosoft:master Feb 17, 2023
@andrewbrey andrewbrey deleted the andrewbrey/feat/pass_thru branch February 17, 2023 20:24
@andrewbrey andrewbrey mentioned this pull request Feb 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants