You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,18 +50,52 @@ If you just want to get the views for an id and don't want to increment the view
50
50
51
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`.
52
52
53
+
### Options
54
+
55
+
```
56
+
$ micro-analytics --help
57
+
Usage: micro-analytics [options] [command]
58
+
59
+
Commands:
60
+
61
+
help Display help
62
+
63
+
Options:
64
+
65
+
-a, --adapter [value] Database adapter used (defaults to "flat-file-db")
66
+
-h, --help Output usage information
67
+
-H, --host [value] Host to listen on (defaults to "0.0.0.0")
68
+
-p, --port <n> Port to listen on (defaults to 3000)
69
+
-v, --version Output the version number
70
+
```
71
+
53
72
### Database adapters
54
73
55
74
By default, `micro-analytics` uses `flat-file-db`, a fast in-process flat file database, which makes for easy setup and backups.
56
75
57
-
This works fine for side-project usage, but for a production application with bajillions of visitors you might want to use a real database with a _database adapter_. Install the necessary npm package (e.g. `micro-analytics-adapter-xyz`) and then specify the `DB_ADAPTER` environment variable: `$ DB_ADAPTER=xyz micro-analytics`
76
+
This works fine for side-project usage, but for a production application with bajillions of visitors you might want to use a real database with a _database adapter_. Install the necessary npm package (e.g. `micro-analytics-adapter-xyz`) and then specify the `DB_ADAPTER` environment variable: `$ DB_ADAPTER=xyz micro-analytics` or use the `--adapter` cli option.
58
77
59
78
These are the available database adapters, made by the community:
Don't see your favorite database here? Writing your own adapter is super easy! See [`writing-adapters.md`](writing-adapters.md) for a simple step-by-step guide.
64
83
84
+
### Live updates
85
+
86
+
micro-analytics has support for live updates with [server-sent events][]. This is an optional feature
87
+
in the adapter backend so check that your chosen backend has the support for it. Below is a little
0 commit comments