Skip to content

Commit 4d839f5

Browse files
committed
more stuff
1 parent d44803b commit 4d839f5

6 files changed

Lines changed: 36 additions & 3 deletions

File tree

run.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ const requestListener = function (req, res) {
3636
res.end(data);
3737
});
3838
}else if (req.url === "/"){
39-
//template stuff
40-
res.writeHead(200)
41-
res.end("N/A")
39+
fs.readFile("templates/start.html", function (err,data) {
40+
if (err) {
41+
res.writeHead(203);
42+
res.end("<html><body><b>internal error</b></body></html>"+JSON.stringify(err));
43+
return;
44+
}
45+
res.writeHead(200);
46+
res.end(data);
47+
});
4248
}else if(req.url.includes("/../")) {
4349
fs.readFile("templates/500.html", function (err,data) {
4450
if (err) {

static/500.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<html>
2+
3+
<body>
4+
<p>
5+
500 Bad Request
6+
</p>
7+
8+
9+
10+
11+
</body>
12+
</html>

static/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nav {
2+
3+
}

static/test2.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<article>
2+
<header>
3+
<h1>A heading here</h1>
4+
<p>Posted by John Doe</p>
5+
<p>Some additional information here</p>
6+
</header>
7+
<p>Lorem Ipsum dolor set amet....</p>
8+
</article>

static/uploadframe.html

Whitespace-only changes.

templates/start.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<html>
22
<head>
33
<title>Upload something</title>
4+
<link rel="stylesheet" type="text/css" href="style.css" />
45
</head>
56
<body>
7+
<nav> <a href= "404.html">404 page</a> <button>Nothing happens here</button></nav>
68

9+
710
</body>
811
<script>
912
let sessioncode = "\\code"
1013

1114
</script>
1215

16+
1317
</html>

0 commit comments

Comments
 (0)