Skip to content
Playground(another site)

bynk.http.cors_not_http

Error A cors { } policy appears on a service that is not from http.

A cors { } block says which other sites a browser may let call the service, and only the HTTP surface has cross-origin browser callers, so it is valid only on a from http service. On a cron or other service it has no request to apply to. Move it to the from http service it was meant for, or delete it. The security, limits and json blocks follow the same rule: bynk.http.security_not_http, bynk.http.limits_not_http, bynk.http.json_not_http.

Example

service jobs from cron {
cors { origins: ["https://app.example.com"] } // ✗ a schedule has no browser callers
on schedule("0 0 * * *") () -> Effect[Result[(), String]] { … }
}
service api from http {
cors { origins: ["https://app.example.com"] } // ✓
on GET("/items") () -> Effect[HttpResult[String]] by v: Visitor { … }
}

In the Book

See also

  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.cors_not_http shows the same from the installed toolchain, without a network.