ReeganExE / node-edge-runtime

Edge Runtime Adapter for Node.js. (View source code on npm).

Home Page:https://npmjs.com/package/node-edge-runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edge Runtime Adapter for Node.js

⚠️ Deprecated.

Use npmjs.com/package/node-edge-server instead.


Sharing the same code between node and other edge runtimes (Deno, Cloudflare workers, Bun, ...)

import { serve } from 'node-edge-runtime'

serve({
  fetch: mainFetch,
  port: 3000, // Port number, default is 3000
})

async function mainFetch(req: Request) {
  const u = new URL(req.url)
  return new Response(u.toString())
}

Support both CommonJS and ESM.

View code: npmjs.com/package/node-edge-runtime?activeTab=code

Original Author

Yusuke Wada https://github.com/yusukebe

License

MIT

About

Edge Runtime Adapter for Node.js. (View source code on npm).

https://npmjs.com/package/node-edge-runtime


Languages

Language:Shell 100.0%