bin/server

changeset 0
14388e456fdf
child 1
5f43030d87fe
equal deleted inserted replaced
-1:000000000000 0:e1efa4340652
1 #!/usr/bin/env node
2
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 }
11
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);
17
18
19
20 console.log('The http server has started at: ' + url);

mercurial