Skip to content

Instantly share code, notes, and snippets.

@blmarket
Created June 23, 2014 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blmarket/8aede5144e5caca378b7 to your computer and use it in GitHub Desktop.
Save blmarket/8aede5144e5caca378b7 to your computer and use it in GitHub Desktop.
queue incoming message into redis queue.
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
@blmarket
Copy link
Author

key name and port is hard-coded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment