Skip to content

ejcx/workerrouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workerrouter

A simple router for Cloudflare Workers.

Example

var workerrouter = new require('workerrouter')
var app = new workerrouter();

app.get('^/account/(?<accountid>[0-9a-f]+)$', function(request) {
  return new Response("Hey it worked " + request.params.accountid)
});

app.post('/hello', async function(request) {
  return new Response('Hello World');
})

addEventListener('fetch', event => {
  event.respondWith(app.listen(event));
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published