Client
Server
Reference / @open-music-sdk/server / tTokenEndpoint
type tTokenEndpoint = (req) => Promise<Response>;Defined in: integrations/server/src/token-endpoint.ts:26
A web-standard handler, to mount wherever your framework takes one: export const GET = tokenEndpoint(…).
Request
The request as the framework hands it over; its method and Origin header are read.
Promise<Response>
The answer: the token as JSON for a GET, 204 for OPTIONS, 405 for any other method.
TypeError if the first mint finds the pem is no key: the minter's own, inside the request, since the handler catches nothing.