michael@0: #!/usr/bin/env node michael@0: michael@0: var http = require('http'), michael@0: port = 8080, michael@0: url = 'http://localhost:' + port + '/'; michael@0: /* We can access nodejitsu enviroment variables from process.env */ michael@0: /* Note: the SUBDOMAIN variable will always be defined for a nodejitsu app */ michael@0: if(process.env.SUBDOMAIN){ michael@0: url = 'http://' + process.env.SUBDOMAIN + '.jit.su/'; michael@0: } michael@0: michael@0: http.createServer(function (req, res) { michael@1: var htmlcode = [ michael@1: '', michael@1: '', michael@1: '
', michael@1: '', michael@1: '', michael@1: '', michael@1: 'Placeholder for forthcoming crossdomain cookie examination.
', michael@1: 'Pending approval from Nodejitsu [1] administrators.
', michael@1: '', michael@1: '', michael@1: '' michael@1: ].join(''); michael@1: michael@1: res.writeHead(200, {'Content-Length': Buffer.byteLength(htmlcode, 'utf8'), michael@1: 'Content-Type': 'text/html;' michael@1: }); michael@1: res.write(htmlcode); michael@0: res.end(); michael@0: }).listen(port); michael@0: michael@0: console.log('The http server has started at: ' + url);