Skip to content
Merged
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
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,47 @@ pnpm install
pnpm dev
```

See [API Documentation](https://ctd.ezmode.games/docs) for endpoints.
### API Endpoints

| Endpoint | Description |
|----------|-------------|
| `POST /crashes` | Submit a crash report |
| `GET /crashes/{id}` | Get crash report details |
| `POST /api-keys` | Create an API key |
| `GET /api-keys` | List your API keys |
| `GET /setup?key=<api_key>` | Download ctd.toml config |
| `GET /patterns` | List crash patterns |
| `GET /patterns/{id}` | Pattern details with mod correlations |
| `GET /calibration/metrics` | Prediction calibration metrics |
| `GET /docs` | Interactive API documentation |

### User Setup

Users need a `ctd.toml` config file with your server URL and their API key.

**Option 1: Download via API**
```bash
curl "https://your-server.com/setup?key=ctd_yourkey" -o ctd.toml
```

**Option 2: Manual creation**
```toml
# ctd.toml
[api]
url = "https://your-server.com"
api_key = "ctd_yourkey"
```

**Installation paths:**
| Game | Path |
|------|------|
| Skyrim SE | `Data/SKSE/Plugins/ctd.toml` |
| Fallout 4 | `Data/F4SE/Plugins/ctd.toml` |
| Fallout 3 | `Data/FOSE/Plugins/ctd.toml` |
| Fallout: New Vegas | `Data/NVSE/Plugins/ctd.toml` |
| Cyberpunk 2077 | `red4ext/plugins/ctd/ctd.toml` |

See [API Documentation](https://ctd.ezmode.games/docs) for full endpoint details.

## License

Expand Down
2 changes: 1 addition & 1 deletion api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.get('/health', (c) => {
// Mount route apps
app.route('/api-keys', apiKeysApp);
app.route('/calibration', calibrationApp);
app.route('/config', configApp);
app.route('/setup', configApp);
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are app-level Vitest smoke tests (e.g., /health, 404), but nothing asserting that the config download route is mounted at the new /setup path. Adding a simple test that /setup responds (e.g., 401 for missing/invalid key) would prevent regressions on future route refactors.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the mount from /config to /setup is a breaking API change: any existing clients calling /config will now get a 404. If backward compatibility is desired, consider temporarily mounting the same router on both paths (or adding a redirect/deprecation response on /config) and documenting a removal timeline.

Suggested change
app.route('/setup', configApp);
app.route('/setup', configApp);
app.route('/config', configApp);

Copilot uses AI. Check for mistakes.
app.route('/crashes', crashesApp);
app.route('/patterns', patternsApp);

Expand Down