For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scaffolding a Service

Background

An app will likely depend on one or more services. Scaffolding a service will by default create the following workflows: record, mock, and test. It additionally will enable creating custom workflows for individual services. To learn more:

Service

Recommended: Add a service step to .stoobly/scaffold.yml and re-apply, rather than running scaffold service create directly. This keeps every service your app depends on reviewable and reproducible in one file.

Applying a Scaffold Config

Steps to Scaffold a Service

  1. Run the scaffold service create command in the root of your app directory:

stoobly-agent scaffold service create \
    --hostname <SERVICE-HOSTNAME> \
    --scheme <SERVICE-SCHEME> \
    --port <SERVICE-PORT> \
    <SERVICE-NAME>

Equivalent .stoobly/scaffold.yml step:

  - resource: service
    action: create
    options:
      service_name: <SERVICE-NAME>
      hostname: <SERVICE-HOSTNAME>
      scheme: <SERVICE-SCHEME>
      port: <SERVICE-PORT>

By default, all three workflows (mock, record, test) are created if you don't specify --workflow options. Use --workflow only when you want to create a subset of workflows.

For example:

After running the command, the following files and folder will be created:

Run the scaffold service list command to list all services. You should see your new service called "samplesapis" as well as others used by Scaffold:

  1. (Optional) For custom container services, define them using the scaffold Docker Compose yaml file. See the following guide:

Customizing Container Services

Next Steps

Now that your service is created, you can now run workflows!

How to Run a Workflow

Or to further customize a workflow, see:

Customizing a Workflow

Last updated