forked from hawkerfun/flower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.js
49 lines (35 loc) · 919 Bytes
/
handler.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
42
43
44
45
46
47
48
49
'use strict';
var request_couter = 0;
module.exports.display = (event, context, callback) => {
/*fs.readFile('views/hello.html', 'utf8', function (err,data) {
if (err) {
const response_test = {
statusCode: 200,
headers : {
"content-type" : "text/html; charset=UTF-8"
},
body: "<html><head></head><body>" + err + "</body></html>"
};
}
console.log(data);
const response_test = {
statusCode: 200,
headers : {
"content-type" : "text/html; charset=UTF-8"
},
body: data
};
callback(null, response_test);
});*/
request_couter++;
const response_test = {
statusCode: 200,
headers : {
"content-type" : "text/html; charset=UTF-8"
},
body: "<html><head></head><body>" +
"Number of request: " + request_couter +
"</body></html>"
};
callback(null, response_test);
};