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
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,13 @@ micro-analytics
21
21
22
22
That's it, the analytics server is now running at `localhost:3000`! 🎉
23
23
24
-
See [`server-setup.md`](./server-setup.md) for instructions on acquiring a server and setting up `nginx` to make your `micro-analytics` publicly available.
24
+
To deploy a server either refer to [`server-setup.md`](./server-setup.md) for instructions on manually acquiring and setting up a server or use [`now`](https://now.sh) and deploy with a single command:
25
25
26
-
> **Note**: You can pass any option to the `micro-analytics` command that you can pass to [`micro`](https://github.com/zeit/micro). As an example, to change the host you'd do `micro-analytics -H 127.0.0.1`
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.
87
+
Don't see your favorite database here? Writing your own adapter is pretty easy, we've even written the tests for you! See [`writing-adapters.md`](writing-adapters.md) for a guide on how to write an adapter for your database of choice.
84
88
85
89
### Live updates
86
90
87
-
micro-analytics also let's you listen into updates live with [server-sent events][].
91
+
micro-analytics let's you listen into updates live with [server-sent events][].
88
92
That means you can e.g. build a realtime dashboard for your analytics!
89
93
90
94
Note: Make sure your database adapter supports this feature. If not, bug them to implement it!
91
95
micro-analytics will tell you when it starts up if it is supported, so the easiest way to find
92
-
out is just to start it up.
96
+
out is to start it up.
93
97
94
98
The example below shows how you can listen for events in the browser, just swap
95
-
micro-analytics.now.sh with your own domain and give it a try.
99
+
`my-deploy.now.sh` with your own domain and give it a try:
sse.addEventListener('micro-analytics-ping', function (e) { console.log('[sse]', e) })
102
106
```
103
107
104
108
#### Browser support
105
109
106
-
Server-sent events is not supported in all browsers. This can easily be fixed by using a polyfill.
107
-
Take a look at [the caniuse table][] for server-sent events if you need one. Polyfills that are
108
-
supported(disclaimer this list is from the documentation of the sse library we use [rexxars/sse-channel][]):
110
+
Server-sent events are not supported in all browsers. There are great, tiny polyfills available, but before you include one take a look at [the caniuse table][] for server-sent events if you need one based on the browsers you support.
Copy file name to clipboardExpand all lines: license.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
The MIT License (MIT)
2
2
3
-
Copyright (c) 2017 Maximilian Stoiber
3
+
Copyright (c) 2017 Maximilian Stoiber & Rolf Erik Lekang
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
0 commit comments