Skip to content

Commit

Permalink
generate server.jsi from js
Browse files Browse the repository at this point in the history
  • Loading branch information
emerleite committed Oct 24, 2010
1 parent aff329a commit 099f4f3
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
(function() {
var app, bayeux, express, faye, port;
express = require('express');
faye = require('faye');
bayeux = new faye.NodeAdapter({
mount: '/faye',
timeout: 45
});
app = express.createServer();
app.configure(function() {
app.use(express.logger());
app.use(express.bodyDecoder());
return app.use(express.staticProvider("" + (__dirname) + "/public"));
});
app.post('/lance', function(req, res) {
if (req.param('token') !== 'abc') {
res.send(403);
return null;
}
bayeux.getClient().publish('/temporeal', {
texto: req.body.texto
});
return res.send(200);
});
port = process.env.PORT || "8000";
bayeux.attach(app);
app.listen(port);
}).call(this);
var express = require('express'),
faye = require('faye');

var bayeux = new faye.NodeAdapter({
mount: '/faye',
timeout: 45
});

var app = express.createServer();
app.configure(function () {
app.use(express.logger());
app.use(express.bodyDecoder());
app.use(express.staticProvider(__dirname + '/public'));
});

app.post('/lance', function(req, res) {
if (req.param('token') != 'abc') { res.send(403); return; }
bayeux.getClient().publish('/temporeal', {texto: req.body.texto});
res.send(200);
});

port = process.env.PORT || "8000";
bayeux.attach(app);
app.listen(port);

0 comments on commit 099f4f3

Please sign in to comment.