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@0: res.writeHead(200, {'Content-Type': 'text/plain'}); michael@0: res.write('hello, I know nodejitsu.'); michael@0: res.end(); michael@0: }).listen(port); michael@0: michael@0: michael@0: michael@0: console.log('The http server has started at: ' + url);