mirror of
https://github.com/coder/registry.git
synced 2026-06-07 23:18:15 +00:00
507b73a07e
Since https://github.com/coder/agentapi/pull/49 was merged, agentapi by default only accepts requests with the `Host` header set to localhost, 127.0.0.1, or [::1]. In Coder, agentapi is served behind a reverse proxy as a workspace app, so we need to use a wildcard `AGENTAPI_ALLOWED_HOSTS` for agentapi-based modules to continue working. This PR updates the claude code and agentapi modules, and a subsequent PR will update modules that are based on the agentapi module.
22 lines
575 B
JavaScript
22 lines
575 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const http = require("http");
|
|
const fs = require("fs");
|
|
const args = process.argv.slice(2);
|
|
const portIdx = args.findIndex((arg) => arg === "--port") + 1;
|
|
const port = portIdx ? args[portIdx] : 3284;
|
|
|
|
console.log(`starting server on port ${port}`);
|
|
fs.writeFileSync("/home/coder/agentapi-mock.log", `AGENTAPI_ALLOWED_HOSTS: ${process.env.AGENTAPI_ALLOWED_HOSTS}`);
|
|
|
|
http
|
|
.createServer(function (_request, response) {
|
|
response.writeHead(200);
|
|
response.end(
|
|
JSON.stringify({
|
|
status: "stable",
|
|
}),
|
|
);
|
|
})
|
|
.listen(port);
|