Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/admin-api-default-off.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"counterfact": minor
---

Admin API is now disabled by default. Use the `--admin-api` flag to opt in.
2 changes: 1 addition & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ npx counterfact@latest [spec] [output] [options]
| `--watch-routes` | `false` | Watch and regenerate routes only |
| `--always-fake-optionals` | `false` | Include optional fields in random responses |
| `--prune` | `false` | Remove route files that no longer exist in the spec |
| `--no-admin-api` | | Disable the Admin API at `/_counterfact/api/*` |
| `--admin-api` | `false` | Enable the Admin API at `/_counterfact/api/*` |
| `--admin-api-token <token>` | _(none)_ | Bearer token required for Admin API endpoints |
| `--no-update-check` | — | Disable the npm update check on startup |
| `--config <path>` | `counterfact.yaml` | Path to a config file |
Expand Down
2 changes: 1 addition & 1 deletion src/cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function buildProgram(version: string, taglines: string[]): Command {
"-b, --build-cache",
"builds the cache of compiled routes and types",
)
.option("--no-admin-api", "disable the admin API at /_counterfact/api/*")
.option("--admin-api", "enable the admin API at /_counterfact/api/*")
.option("-r, --repl", "start the REPL")
.option("--proxy-url <string>", "proxy URL")
.option(
Expand Down
Loading