A connect/express middleware for the Racer realtime model synchronization engine with support for routes and validation
Express/Connect middleware that delivers Racer realtime model synchronization engine with routes and validation support.
For instance, you could do
appuse"/racer" require"racer-middleware"db: require"livedb-mongo""localhost:27017/test?auto_reconnect" safe: trueroutes:modelset"_page.authenticated" reqisAuthenticated;modelsubscribe"library"done;;cbshareRequestagentreqisAuthenticated;;
Client (with RequireJS):
require"/racer"racerload"/racer/library"var authenticated = modelget"_page.authenticated"books = modelget"library.books";/* etc */;;
See example/ for a more complete example.
- You need redis-server >= 2.6 and node >= 0.10 running on your machine for racer to work.
- Make sure the mongo url in the example is pointing to a running mongo server before running the example.