This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Do enable nodejs_compat | |
| // https://developers.cloudflare.com/workers/runtime-apis/nodejs/ | |
| import crypto from 'node:crypto' | |
| import { Context, Hono } from 'hono' | |
| const app = new Hono() | |
| function generateJWT(payload, secret, expiresIn) { | |
| const header = { alg: 'HS256', typ: 'JWT' } | |
| const encodedHeader = base64UrlEncode(JSON.stringify(header)) |