Workflow
A workflow groups configurations for services to perform distinct use cases. By default, Stoobly provides configurations for four workflows: record, mock, test, and develop. Use --workflow when creating a service to select a subset instead of all four (see the Scaffold FAQ for details).
Background
To learn more about the role of individual services, see:
ServiceTo run a workflow, see:
How to Run a WorkflowTo validate a workflow, see:
ValidationFile Structure
Any hidden file will be overritten when the scaffold service create command is rerun.
Core Workflows
Record

The journey of a request:
A request gets sent from the host e.g. browser or cURL
Gets sent to the gateway service
Gateway service routes the request based on hostname
Request gets intercepted by Stoobly running as a proxy
Lifecycle hooks get triggered
Stoobly reverse proxies the request to the local or external API
On response, Stoobly records the request to its respective
.stooblyfolderLifecycle hooks get triggered
Mock

The journey of a request:
A request gets sent from the host e.g. browser or cURL
Gets sent to the gateway service
Gateway service routes the request based on hostname
Request gets intercepted by Stoobly running as a proxy
Lifecycle hooks get triggered
Stoobly mocks requests if it has been previously recorded. If the request is not found, it can conditionally reverse proxy the request to the local or external API
Lifecycle hooks get triggered
Test

The journey of a request:
A request gets sent from the entrypoint service
Gateway service routes the request based on hostname
Request gets intercepted by Stoobly running as a proxy
Lifecycle hooks get triggered
Stoobly mocks requests if it has been previously recorded. If the request is not found, it can conditionally reverse proxy the request to the local or external API
Lifecycle hooks get triggered
Develop
Unlike record, mock, and test, the develop workflow isn't about capturing or replaying fixed responses.
It's for working against a service's real hostname (e.g. an endpoint your app already calls in staging or production) while transparently redirecting requests to a local development server.
This redirection is driven by rewrite rules generated from the service's configured upstream hostname, port, and scheme. Whenever a service's upstream configuration changes, resync its develop rewrite rules with:
The journey of a request:
A request gets sent from the host e.g. browser or cURL
Gets sent to the gateway service
Gateway service routes the request based on hostname
Request gets intercepted by Stoobly running as a proxy
Lifecycle hooks get triggered
Stoobly rewrites the request, redirecting it from the service's original upstream hostname, port, and scheme to the local development target defined by the synced rewrite rules
Stoobly reverse proxies the rewritten request to the local development server and returns its response to the host
Lifecycle hooks get triggered
develop is created automatically along with record, mock, and test whenever you run scaffold service create without a --workflow filter:
Last updated