-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestHandlers.js
More file actions
43 lines (33 loc) · 970 Bytes
/
requestHandlers.js
File metadata and controls
43 lines (33 loc) · 970 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
34
35
36
37
38
39
40
41
42
/**
* Created by lpc on 28/03/15.
*/
fs = require('fs');
path = require('path');
function getMessage(response){
response.writeHead(404, {"Content-Type": "text/plain"});
response.write("From The Expanded App");
response.end();
}
function getPicture(response){
//var picturePathText = path.join(_dirName, );
if (fs.existsSync('./orangeBirthday.jpeg'))
{
var img = fs.readFileSync('./orangeBirthday.jpeg');
}
response.writeHead(404, {"Content-Type": "image/jpeg"});
response.end(img);
}
function getMusic(response){
response.writeHead(404, {"Content-Type": "text/plain"});
response.write("No music available");
response.end();
}
function postMessage(response){
response.writeHead(404, {"Content-Type": "text/plain"});
response.write("No post");
response.end();
}
exports.getMessage = getMessage;
exports.getPicture = getPicture;
exports.getMusic = getMusic;
exports.postMessage = postMessage;