Created
December 31, 2012 00:24
-
-
Save andrewrk/4416337 to your computer and use it in GitHub Desktop.
This file contains 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
var path = require('path'); | |
var http = require('http'); | |
var express = require('express'); | |
var assert = require('assert'); | |
app = express(); | |
app.configure('development', function () { | |
app.use(express.errorHandler()); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
}); | |
app.get('/event-test', function (request, response) { | |
response.json({type: "event", message: "test"}); | |
}); | |
var server = http.createServer(app); | |
server.listen(9877, function () { | |
var req = http.get("http://localhost:9877/event-test", function(resp) { | |
assert.strictEqual(resp.statusCode, 200); | |
server.close(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment