Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View q-http-queue.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
var HTTP = require("q-io/http");
var Q = require("q");
var Queue = require("q/queue");
var port = 8000;
 
exports.QueueApp = function () {
var queue = Queue();
return function (request) {
if (request.method == "GET") {
return {
"status": 200,
"headers": {"Content-Type": "text/plain"},
"body": queue.get()
};
} else if (request.method == "POST") {
queue.put(request.body);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.