Created
January 4, 2012 01:16
-
-
Save akidee/1557912 to your computer and use it in GitHub Desktop.
Serve the RequireJS test suite with HTTP (via node.js)
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
/* | |
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