import express from 'express';
import stream from 'express-sse';
const app = express();
const clockFn = async () => new Date(Date.now()).toLocaleTimeString();
app.use('/clock', stream('clock', clockFn));
app.listen(8080, () => {
console.log('listening on port 8080');
});
Eyal-Shalev/express-sse
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple Express Server Sent Events Middleware (using TypeScript)
Resources
Stars
Watchers
Forks
Packages 0
No packages published