-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp3.js
More file actions
33 lines (27 loc) · 765 Bytes
/
app3.js
File metadata and controls
33 lines (27 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('<html>'+
' <head>'+
' <title>Hello World</title>'+
' </head>'+
' <body>'+
' <h1>Hello World</h1>'+
' </body>'+
'</html>');
});
app.get('/admin', function (req, res) {
res.send('<html>'+
' <head>'+
' <title>Admin</title>'+
' </head>'+
' <body>'+
' <h1>Hay, you are on the admin page!</h1>'+
' </body>'+
'</html>');
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});