Mon, 22 Dec 2014 23:02:08 +0100
Import initial revision of new project Crosscook.
1 #!/usr/bin/env node
3 var http = require('http'),
4 port = 8080,
5 url = 'http://localhost:' + port + '/';
6 /* We can access nodejitsu enviroment variables from process.env */
7 /* Note: the SUBDOMAIN variable will always be defined for a nodejitsu app */
8 if(process.env.SUBDOMAIN){
9 url = 'http://' + process.env.SUBDOMAIN + '.jit.su/';
10 }
12 http.createServer(function (req, res) {
13 res.writeHead(200, {'Content-Type': 'text/plain'});
14 res.write('hello, I know nodejitsu.');
15 res.end();
16 }).listen(port);
20 console.log('The http server has started at: ' + url);