Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ const requestListener = function (req, res) {
res.end(data);
});
}else if (req.url === "/"){
//template stuff
res.writeHead(200)
res.end("N/A")
fs.readFile("templates/start.html", function (err,data) {
if (err) {
res.writeHead(203);
res.end("<html><body><b>internal error</b></body></html>"+JSON.stringify(err));
return;
}
res.writeHead(200);
res.end(data);
});
}else if(req.url.includes("/../")) {
fs.readFile("templates/500.html", function (err,data) {
if (err) {
Expand Down
12 changes: 12 additions & 0 deletions static/404.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
body {
font-size: 80px;
font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
align-items: center;
background-color: black;
color: white;
align-items: center;
}
p {
vertical-align: middle;
text-align: center;
}
12 changes: 12 additions & 0 deletions static/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>

<body>
<p>
500 Bad Request
</p>




</body>
</html>
3 changes: 3 additions & 0 deletions static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nav {

}
8 changes: 8 additions & 0 deletions static/test2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<article>
<header>
<h1>A heading here</h1>
<p>Posted by John Doe</p>
<p>Some additional information here</p>
</header>
<p>Lorem Ipsum dolor set amet....</p>
</article>
Empty file added static/uploadframe.html
Empty file.
17 changes: 11 additions & 6 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<html>
<head>
<title>
404 Not Found
</title>
</head>
<link rel="stylesheet" type="text/css" href="404.css" />
<body>
<h1>
404.
</h1>
<h2>
<i>Unexisting things cannot be found</i>
</h2>
<div class = container></div>

<p>404</p>
<p><i>Unexisting things cannot be found</i></p>
</div>
</body>
</html>
14 changes: 8 additions & 6 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<html>

<body>
<h1>
500
</h1>
<h2>
You asked for something dangerous
</h2>
<p>
500 Bad Request
</p>




</body>
</html>
1 change: 1 addition & 0 deletions templates/rick.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Test</title>
</head>
<body>
Expand Down
6 changes: 5 additions & 1 deletion templates/start.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<html>
<head>
<title>Upload something</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<nav> <a href= "404.html">404 page</a> <button>Nothing happens here</button></nav>


</body>
<script>
let sessioncode = "\\code"

</script>


</html>