Skip to content

add http middleware template - #3617

Open
michelleN wants to merge 1 commit into
spinframework:mainfrom
michelleN:middleware-template
Open

add http middleware template#3617
michelleN wants to merge 1 commit into
spinframework:mainfrom
michelleN:middleware-template

Conversation

@michelleN

@michelleN michelleN commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Opened up this draft PR as an additional resource to visualize #3618.
This is an attempt to add an http middleware template for both the spin new and spin add experience. I ran into a few issues.

Comment thread templates/http-middleware/metadata/snippets/component.txt Outdated
[add_component]
skip_files = ["spin.toml"]
[add_component.snippets]
component = "component.txt"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding middleware to an existing app would require post add instructions including adding the middleware to dependencies under the correct trigger section.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be unavoidable - presumably the reason you're building your thing as middleware rather than including it in component source code is that you want to apply it to multiple triggers. (Although I guess another case is "my app is an off-the-shelf component like the fileserver but I want to wrap it." So maybe sometimes we do want to be able to auto-add it to triggers. But yeah, we don't have syntax for that yet.)

Comment thread templates/http-middleware/content/spin.toml
Signed-off-by: Michelle Dhanani <mdhanani@akamai.com>
@michelleN
michelleN force-pushed the middleware-template branch from f3a7a64 to 1423ddf Compare July 28, 2026 23:43
@michelleN michelleN changed the title WIP: add http middleware template add http middleware template Jul 28, 2026
@michelleN
michelleN marked this pull request as ready for review July 28, 2026 23:59
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