author | cu |
Mon, 23 Oct 2017 21:00:14 +0100 | |
changeset 557 | 192d01998ebd |
parent 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){ |
383
3e1a2c8ed980
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
163
diff
changeset
|
5 |
response.write('<H1>Hello World</H1>'); |
163
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/"); |