Basic usage
export default {
async fetch(req, env, ctx) {
const value = await env.MY_KV.get("hello");
const stmt = env.MY_DB.prepare("INSERT INTO logs VALUES (?, ?)");
const rows = await stmt.bind(value, 42).run();
},
};
Create worker and invoke from its handler(fetch
, scheduled
, tail
, etc...).