Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 17 lines (13 sloc) 0.47 kB
ed4856f @andrewrk rename superjoe30 to andrewrk
authored
1 [![Build Status](https://secure.travis-ci.org/andrewrk/connect-sse.png)](http://travis-ci.org/andrewrk/connect-sse)
1d1918b @andrewrk add travis ci
authored
2
bd6683f @andrewrk initial commit
authored
3 Usage:
4 ------
5
a58349b @andrewrk cleanup readme code
authored
6 ```js
7 var sse = require('connect-sse')();
8 var express = require('express')
bd6683f @andrewrk initial commit
authored
9
a58349b @andrewrk cleanup readme code
authored
10 var app = express()
bd6683f @andrewrk initial commit
authored
11 app.get('/events', sse, function (req, res) {
f1a981c @andrewrk fix, add test
authored
12 res.json("this is an event");
13 res.json({here: "is", another: "event"});
9ebd18f Added ability to send named events
Sergii Pashko authored
14 res.json({here: "is a named event", to: "listen with addEventListener('example', function(){})"}, "example");
bd6683f @andrewrk initial commit
authored
15 });
16 ```
Something went wrong with that request. Please try again.