Skip to content

Instantly share code, notes, and snippets.

View nathanclevenger's full-sized avatar
🚀

Nathan Clevenger nathanclevenger

🚀
View GitHub Profile
export default ([ collection, id, method = 'get' ], env) => env.KV.get(collection + '/' + id)
export default {
'/': () => { hello: 'world' },
'/:collection': ({collection}) => { collection },
'/:collection/:id': ({collection,id}) => { collection, id },
}
@nathanclevenger
nathanclevenger / worker.js
Last active August 28, 2022 15:10
hello
// import graphdl from 'https://pkg.do/[email protected]'
export default {
fetch: (req, env, ctx) => {
return new Response(JSON.stringify({hello: 123}, { headers: { 'content-type': 'application/json' }})
}
}