-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
41 lines (27 loc) · 1022 Bytes
/
script.js
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
34
35
36
37
38
39
40
41
var connect = require('connect');
var fs = require('fs');
fs.readFile('./public/pg1.html', function(err, data){
//console.log("Here");
if(err)
throw err;
var app = connect()
.use(connect.bodyParser())
.use(connect.static('public'))
.use(function (req, res) {
if (req.url == '/process'){
res.writeHead(200,{'Content-Type':'text/html'})
res.write(req.body.FirstName + '! name your collection room');
res.write('<style> img {display:block;}</style>');
res.write(" ");
res.write('<img src="http://thehomepicz.com/wp-content/uploads/2014/02/empty-Room.jpg" width="500">');
res.write('<style> img {display:block;}</style>');
res.write(" ");
res.write('<label for="RoomName">Room Name: </label><input type="text" name="RoomName" value="" id="RoomName">')
//res.writeHead(200,{'Content-Type':'text/html'})
//res.write(req.body.FirstName + '! name your collection room');
res.end();
}else {res.end("invalid Request");
}
})
.listen(3000);
});