Running Spin Applications
- Specifying the Application to Run
- Application Output
- Persistent Logs
- Trigger-Specific Options
- Next Steps
Once you have created and built your application, it’s ready to run. To run an application, use the
spin up command.
Specifying the Application to Run
spin up looks for a file named
spin.toml in the current directory.
If your manifest is named something different, or isn’t in your current directory, use the
--from) flag. You also use
-f to run remote applications.
|File name: ||Runs the specified manifest file|
|Directory name: ||Looks for a |
|Registry reference: ||Pulls the application from the registry and runs that|
If Spin misunderstands a registry reference as a file name, or vice versa, you can use
If you see the error
failed to resolve content at "example.wasm"(where
example.wasmis the module file of a component), check that the application has been built.
Testing HTTP Applications
By default, HTTP applications listen on
localhost:3000. You can override this with the
--listen option. Spin prints links to the application components to make it easy to open them in the browser or copy them to
curl commands for testing.
By default, Spin prints application output, and any of its own error messages, to the console.
To hide application output, pass the
$ spin up --quiet
To limit application output to specific components, pass the
$ spin up --follow cart --follow cart-api
- If you run an application from the file system (a TOML file), Spin saves a copy of the application output and error messages. This is saved in the
.spin/logsdirectory, under the directory containing the manifest file.
- If you run an application from a registry reference, Spin does not save a copy of the application output and error messages; they are only printed to the console.
To control logging, pass the
--log-dir flag. The logs will be saved to the specified directory (no matter whether the application is local or remote).
$ spin up --log-dir ~/dev/bugbash
Some trigger types support additional
spin up flags. For example, HTTP applications can have a
--listen flag to specify an address and port to listen on. See the HTTP trigger and Redis trigger pages for more details.
- Learn how to create and update a Spin application
- Learn about how to configure your application at runtime
- See how to package and distribute your application
- Try deploying your application to run in the Fermyon Cloud
Did we miss something?
Let us know how we can improve this project, or contribute an edit to this page. We really appreciate your feedback, to help us build better tools.