https://www.npmjs.com/package/node-fetch
What I’m looking for is a server framework (like express.js) which uses these standards instead of their home made APIs. So instead of:
app.use(json()); app.get("/echo", (req, res) { const { message } = req.body; res.append("Content-Type", "application/json"); res.send(JSON.stringify({ message })); });
app.get("/echo", async (request) => { const { message } = await request.json(); const headers = new Headers([[ "Content-Type", "application/json" ]]); return new Response( JSON.stringify({ message }), { headers }, ); });
What I’m looking for is a server framework (like express.js) which uses these standards instead of their home made APIs. So instead of:
I could write something like: