/** * Module dependencies. */ var http = require('http') , fs = require('fs'); var args = process.argv.slice(2) , port = args.length ? parseInt(args[0], 10) : 3000; var images = fs.readdirSync(__dirname + '/images').sort(); function ul(items) { var buf = '
Not Found
'); } else { res.writeHead(200, { 'Content-Type': 'image/png' , 'Content-Length': buf.length }); res.end(buf); } }); } }).listen(port); console.log('Test image server started on port ' + port);