opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(server): enable CORS wildcard via Hono middleware

Open ScriptedAlchemy opened this issue 6 months ago • 3 comments

Adds Hono cors() middleware at top-level (app.use("*", cors())). This sets Access-Control-Allow-Origin: * for all routes, including preflight. If credentialed requests are needed later, we can switch to a dynamic origin function and set credentials: true.

ScriptedAlchemy avatar Sep 12 '25 14:09 ScriptedAlchemy

Adding this to make it easier to access opencode server from the browsers / apps without having to build out reverse proxies to it.

ScriptedAlchemy avatar Sep 12 '25 14:09 ScriptedAlchemy

this is added in dev already, I needed it for the desktop app, can you pull and make sure it's working for your case @ScriptedAlchemy?

adamdotdevin avatar Sep 19 '25 10:09 adamdotdevin