Scaffolding a Service

Background

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

Steps to Scaffold a Service

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

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

For example:

stoobly-agent scaffold service create \
    --hostname api.sampleapis.com \
    --scheme https \
    --port 443 \
    --workflow mock \
    --workflow record \
    --workflow test \
    sampleapis
  1. After running the command, the following files will be created:

$ ls -a .stoobly/docker/sampleapis
.config.yml .docker-compose.base.yml mock record test

From the above, we can see that folders for mock, record, and test workflows are created by default.

Last updated