Skip to content

Instantly share code, notes, and snippets.

@callahanrts
Created June 18, 2014 16:51
Show Gist options
  • Save callahanrts/bd64453aace421271a26 to your computer and use it in GitHub Desktop.
Save callahanrts/bd64453aace421271a26 to your computer and use it in GitHub Desktop.
The server that is created to accept notifications from the chrome extension
@app = express();
@app.use(bodyParser())
@app.all '/*', (req, res, next) ->
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
server = @app.listen 51932, () ->
console.log('Listening on port %d', server.address().port);
@app.post '/new', (req, res) =>
@setNotifications(req.body.messages)
res.send("success!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment