Created
June 23, 2014 05:49
-
-
Save blmarket/8aede5144e5caca378b7 to your computer and use it in GitHub Desktop.
queue incoming message into redis queue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http = require 'http' | |
redis = require 'redis' | |
bodyParser = require 'body-parser' | |
express = require 'express' | |
app = express() | |
redis_client = redis.createClient '/var/run/redis/redis.sock' | |
app.post '/', bodyParser.json(), (req, res) -> | |
redis_client.lpush 'flickr', JSON.stringify(req.body) # we don't need to wait. | |
res.send 200 | |
return | |
http.createServer(app).listen 3232, -> | |
console.log 'server listening' | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
key name and port is hard-coded.