Skip to content

Instantly share code, notes, and snippets.

@akidee
Created January 4, 2012 01:16
Show Gist options
  • Save akidee/1557912 to your computer and use it in GitHub Desktop.
Save akidee/1557912 to your computer and use it in GitHub Desktop.
Serve the RequireJS test suite with HTTP (via node.js)
/*
The test suite should be served via HTTP (instead of using the file protocol)
To accomplish this, we set up a node.js server.
For this, you need node.js and the connect middleware (npm install connect)
Start the server:
$ node nodeStaticServer.js PORT
Then you browse to http://127.0.0.1:PORT/tests/doh/runner.html?testUrl=../all
*/
var connect = require('connect')
var server = connect.createServer()
server.use('/', connect.static(__dirname+'/..', { maxAge: 0 }))
server.listen(parseInt(process.argv[2], 10) || 4000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment