Skip to content

Commit cda3acf

Browse files
authored
Merge pull request #47 from micro-analytics/use-underscore
/realtime -> /_realtime
2 parents 58596e0 + a6e73b2 commit cda3acf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The example below shows how you can listen for events in the browser, just swap
9999
`my-deploy.now.sh` with your own domain and give it a try:
100100

101101
```es6
102-
const sse = new EventSource('https://my-deploy.now.sh/realtime')
102+
const sse = new EventSource('https://my-deploy.now.sh/_realtime')
103103
sse.onopen = function () { console.log('[sse] open') }
104104
sse.onerror = function (error) { console.error('[sse error]', error) }
105105
sse.addEventListener('micro-analytics-ping', function (e) { console.log('[sse]', e) })

src/handler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (db.hasFeature("subscribe")) {
1616
module.exports = async function (req, res) {
1717
const { pathname, query } = url.parse(req.url, /* parseQueryString */ true)
1818

19-
if (pathname === '/realtime') {
19+
if (pathname === '/_realtime') {
2020
if (sse) {
2121
sse.addClient(req, res);
2222
} else {

0 commit comments

Comments
 (0)