bin/server

Mon, 22 Dec 2014 23:02:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 22 Dec 2014 23:02:08 +0100
changeset 0
14388e456fdf
child 1
5f43030d87fe
permissions
-rwxr-xr-x

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);

mercurial