No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js Remove configuration func for 404. Jan 15, 2019
package.json
yarn.lock

README.md

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));
})