Re: [w3c/ServiceWorker] Declarative routing (#1373)

You're right; that would be better. My point is not so much that it's a *good* thing to have a path matching multiple domains, but having something like `pathStartsWith` isn't necessarily creating a new problem.

I know I could get my example to work using `RouterIfURLStarts` and `RouterIfURL` (or whatever equivalent API you decide to go with), so I think the conditions in your current draft are sufficient for a v1, but having conditions for each part of a request (`href`, `protocol`, `hostname`, `pathname`, `search`, `method`, and `headers`) would be nice to have.

To go even deeper, I'd love to be able to do something like 

```javascript
router.add(
  new RouterNot(new RouterConditionHasCookie('I_AM_LOGGED_IN')),
  new RouterSourceCache({ request: '/login.html' })
)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1373#issuecomment-452659185

Received on Wednesday, 9 January 2019 11:08:30 UTC