diff -r 000000000000 -r 14388e456fdf bin/server --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/server Mon Dec 22 23:02:08 2014 +0100 @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +var http = require('http'), + port = 8080, + url = 'http://localhost:' + port + '/'; +/* We can access nodejitsu enviroment variables from process.env */ +/* Note: the SUBDOMAIN variable will always be defined for a nodejitsu app */ +if(process.env.SUBDOMAIN){ + url = 'http://' + process.env.SUBDOMAIN + '.jit.su/'; +} + +http.createServer(function (req, res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.write('hello, I know nodejitsu.'); + res.end(); +}).listen(port); + + + +console.log('The http server has started at: ' + url);