This node.js library seeks to combine express and socket.io into one cohesive library. This project started as a fork of express.oi. This README is a fork too.
Getting started
First install:
npm install express-oi
Then, simply replace this line of code
with this line of code
Your app should run just the same as before! express-oi is designed to be a superset of express and socket.io.
Usage
Setting up the app
var express = ; var app = ; app; // Here we create http.Server instance and connect socket.io to our app// Socket.io DEBUG disabled if app env is not "development"app;// or if socket.io DEBUG no longer needed in app development env// app.http().io({debug:false}); // Pass in your express-session configuration// Documentation here: https://github.com/expressjs/session#sessionoptions// Just config options, dep. "express-session" are included in express-oi// app.io.session() includes session both to app and app.ioappio; app;
express-oi routes
var messages = ; appio;
Forwarding express routes
Regular express routes can be forwarded to express-oi routes
app ;
More API Examples
// express-oi routesappio;
Changelog
0.0.21 - Enable socket.io DEBUG for app development env 0.0.20 - Fix session in io.route middleware 0.0.19 and earlier - See express.oi
Roadmap
sticky-session integration or emulating it.