Telegraph
Telegraph aims to combine Express with Socket.IO to into a reactor pattern style web framework for quickly building event heavy projects.
Get started:
npm install telegraph -g
telegraph init
npm install -d
telegraph start
// Current defaults for Telegraphmoduleexports = App ='appname' : "Telegraph" // For aesthetic purposes, the name of the application'websockets' : true // Enables websocket events via socket.io'view engine' : 'ejs' // The templating engine used to render views;
Starting the Server:
telegraph start
or use foreman
foreman start
Configuration
Configure the express server like so:
App;App;App;
Routes
Follow traditional express routing
App;App;App;
Websocket Events
App;
Using Databases
By default, Telegraph uses loose wrappers around Backbone Models and
Collections as a temporary datastore. CouchDB
can be configured in the /config/database.json
file:
This will setup cradle for the above settings at App.db
.
Heroku Hosting:
Telegraph is already configured for Heroku Cedar Stack. After running a telegraph init
, do the following:
heroku create --stack cedar
git push heroku master