Configuration
Configure Restlyn paths, base URLs, data directories and request headers using .restlynrc.
On this page
Restlyn reads .restlynrc from the current project directory. It uses INI
syntax. Root-level settings must appear before the first section.
Example configuration
localMode = true
timeout = 5000
testData = data
features = features
tests = generated/tests
stepmaps = generated/stepmaps
schemas = schemas
report = generated/report
[baseUrls]
local = http://127.0.0.1:4000
prod = https://api.example.com
[globalHeaders]
Authorization = Bearer sample-token
sample-token is a placeholder. Keep real credentials out of committed examples.
The included mock’s protected profile endpoint accepts mocked-token-123.
Settings and sections
| Setting | Purpose |
|---|---|
Root localMode |
Selects the local base URL when a scenario has no explicit base URL |
Root timeout |
Mocha test timeout in milliseconds; defaults to 5000 |
Root testData |
Data directory used during test generation; defaults to data |
Root features, stepmaps, tests, schemas, report |
Paths shared by generation, schema lookup and verification |
[baseUrls] |
Local and production base URLs |
[globalHeaders] |
Headers included in generated request configuration |
Use testData for the data folder, root report for reports and
globalHeaders for request headers. Putting these values under [test],
[settings] or [headers] does not configure those root-level settings.
Version 0.1.1 also supports [paths] for verification/reporting and schema lookup,
but the steps and tests commands read the root path keys. Using the root keys
shown above keeps all commands consistent. A steps --file login.feature argument
is resolved inside the configured feature root; tests --file is likewise
relative to the configured step-map root. Use an absolute path when needed.
Explicit URLs and environments
A base URL written in a scenario takes precedence over the configured base URL.
The tests --env local or --env prod override affects generation. The schema
command also accepts --env local or --env prod; an absolute --url is used
as supplied. The built-in mock server uses port 4000; .restlynrc does not
change its listening port.
Override paths on the command line
restlyn tests --schemas schemas-prod/
restlyn verify --generated custom-tests/
For a local package installation, prefix these commands with npx --no-install.
Use CLI reference for available arguments.
Regenerate after configuration changes
Each CLI process reads the configuration when it starts. URLs, headers and data paths can be embedded in generated tests, so regenerate the tests after changing generation settings. You do not need to restart a persistent Restlyn CLI service.
Migrated from the Restlyn documentation, with reviewed example and configuration corrections. Original Restlyn documentation.