Skip to content

Commit b117feb

Browse files
authored
Merge pull request #5 from J-P-S-O/master
Master
2 parents 8c0b587 + 4d839f5 commit b117feb

10 files changed

Lines changed: 69 additions & 16 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/404.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
body {
2+
font-size: 80px;
3+
font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
4+
align-items: center;
5+
background-color: black;
6+
color: white;
7+
align-items: center;
8+
}
9+
p {
10+
vertical-align: middle;
11+
text-align: center;
12+
}

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/404.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<html>
2+
<head>
3+
<title>
4+
404 Not Found
5+
</title>
6+
</head>
7+
<link rel="stylesheet" type="text/css" href="404.css" />
28
<body>
3-
<h1>
4-
404.
5-
</h1>
6-
<h2>
7-
<i>Unexisting things cannot be found</i>
8-
</h2>
9+
<div class = container></div>
10+
11+
<p>404</p>
12+
<p><i>Unexisting things cannot be found</i></p>
13+
</div>
914
</body>
1015
</html>

templates/500.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<html>
2+
23
<body>
3-
<h1>
4-
500
5-
</h1>
6-
<h2>
7-
You asked for something dangerous
8-
</h2>
4+
<p>
5+
500 Bad Request
6+
</p>
7+
8+
9+
10+
911
</body>
1012
</html>

templates/rick.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<html>
22
<head>
3+
<link rel="stylesheet" type="text/css" href="style.css" />
34
<title>Test</title>
45
</head>
56
<body>

templates/start.html

Lines changed: 5 additions & 1 deletion
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"
10-
13+
1114
</script>
1215

16+
1317
</html>

0 commit comments

Comments
 (0)