author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Fri, 10 Oct 2014 13:09:06 +0100 | |
changeset 236 | 40efc28963af |
parent 163 | 02026ee18378 |
child 383 | 3e1a2c8ed980 |
permissions | -rw-r--r-- |
163
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
var express = require('express'); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
var app = express(); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
|
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
app.get('/', function(request, response){ |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
response.write('Hello World'); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
response.end() |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
}); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
// alternative response |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
//response.write('<H1>Hello World</H1>'); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
|
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
// starting the server |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
app.listen(8000); |
02026ee18378
added js files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
console.log("Server running at http://127.0.0.1:8000/"); |