Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Created January 13, 2013 04:06
Show Gist options
  • Save rrichardson/4522219 to your computer and use it in GitHub Desktop.
Save rrichardson/4522219 to your computer and use it in GitHub Desktop.
var flatiron = require('flatiron'),
ecstatic = require('ecstatic'),
socketful = require('socketful'),
restful = require('restful'),
models = require('./models').fixtures;
var app = module.exports = flatiron.app;
app.use(flatiron.plugins.http, {
before: [
ecstatic(__dirname + '/public')
]
});
app.resources = require('./models').Models;
for(var r in app.resources) {
app.resources[r].restful = true;
app.resources[r].socketful = true;
}
console.dir(app.resources);
app.use(restful);
app.start(8000, function(){
console.dir(app.router.routes);
socketful.createServer(models, { server: app.server }); // Socket.io
//restful.createServer(models, { server: app.server });
// -------------------------------------------------- //
console.log(' > http server started on port 8000');
console.log(' > visit: http://localhost:8000/ ');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment