Skip to content

Support combining the command trigger with other triggers #7

@mikkelhegn

Description

@mikkelhegn

Currently if I combine the command trigger with an http trigger, Spin exits after having run the command trigger, maning that my http trigger does not stay up listening. One scenrio for this use-case would be to run some initialization logic as a command trigger, for an api being served using the http trigger.

spin_manifest_version = 2

[application]
authors = ["Mikkel Mørk Hegnhøj <[email protected]>"]
description = "Just a command trigger"
name = "command-trigger"
version = "0.1.0"

[[trigger.command]]
component = "command"

[component.command]
source = "../command/target/wasm32-wasi/release/command.wasm"
build = ["cargo component build --target wasm32-wasi --release --manifest-path ../command/Cargo.toml"]

[[trigger.http]]
route = "/..."
component = "another"

[component.another]
source = "another/target/another.wasm"
[component.another.build]
command = "npm run build"
workdir = "another"
> spin up
Logging component stdio to ".spin/logs/"
Logging component stdio to ".spin/logs/"
Hello, world!

Serving http://127.0.0.1:3000
Available Routes:
  another: http://127.0.0.1:3000 (wildcard)

> _

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions