Skip to content

Commit e2cfef2

Browse files
committed
Document all filtering behaviour
1 parent b00571d commit e2cfef2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ See [`server-setup.md`](./server-setup.md) for instructions on acquiring a serve
2828

2929
### Tracking views
3030

31-
To track a view of `x`, simply send a request to `/x`. If you send a `GET` request, the request will increment the views and return the total views for the id. (in this case "x") If you send a `POST` request, the views will increment but you don't get the total views back.
32-
33-
This is how you'd track pageviews for a website: (though note that this can be used to track anything you want)
31+
To track a view of `x`, simply send a request to `/x`. This is how you'd track page views for a website: (though note that this can be used to track anything you want)
3432

3533
```HTML
3634
<script>
@@ -42,9 +40,15 @@ This is how you'd track pageviews for a website: (though note that this can be u
4240
</script>
4341
```
4442

43+
If you send a `GET` request, the request will increment the views and return the total views for the id. (in this case "x") If you send a `POST` request, the views will increment but you don't get the total views back.
44+
45+
#### `GET` the views without incrementing
46+
4547
If you just want to get the views for an id and don't want to increment the views during a `GET` request, set `inc` to `false` in your query parameter. (`/x?inc=false`)
4648

47-
If you want to get all views for all ids, set the `all` query parameter to `true`. (`/?all=true`) If you pass the `all` parameter to an id, all ids starting with that pathname will be included. (e.g. `/x?all=true` will match views for `/x`, `/xyz` but not `/y`)
49+
### Getting all views
50+
51+
If you want to get all views for all ids, set the `all` query parameter to `true` on a root request. (i.e. `/?all=true`) If you pass the `all` parameter to an id, all ids starting with that pathname will be included. E.g. `/x?all=true` will match views for `/x`, `/xyz` but not `/y`.
4852

4953
## Built with
5054

0 commit comments

Comments
 (0)