Skip to content

Commit 97dc623

Browse files
committed
add something
1 parent 59e026f commit 97dc623

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

run.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,29 @@ if (fs.existsSync("data")) {
2525

2626
const requestListener = function (req, res) {
2727
log(req.url)
28-
28+
if (req.url === "/test"){
29+
fs.readFile("templates/rick.html", function (err,data) {
30+
if (err) {
31+
res.writeHead(404);
32+
res.end(JSON.stringify(err));
33+
return;
34+
}
35+
res.writeHead(200);
36+
res.end(data);
37+
});
38+
}else if (req.url === "/"){
39+
40+
}else {
41+
fs.readFile("static" + req.url, function (err,data) {
42+
if (err) {
43+
res.writeHead(404);
44+
res.end(JSON.stringify(err));
45+
return;
46+
}
47+
res.writeHead(200);
48+
res.end(data);
49+
});
50+
}
2951
}
3052

3153
const server = http.createServer(requestListener);

static/favicon.ico

190 KB
Binary file not shown.

templates/rick.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<title>Test</title>
4+
</head>
5+
<body>
6+
<iframe height="350" width="600"
7+
src="https://www.youtube.com/embed/dQw4w9WgXcQ">
8+
</iframe>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)