From d44803b95edbbe2827f670f6a89fbf0695655697 Mon Sep 17 00:00:00 2001 From: jp Date: Mon, 29 Nov 2021 14:55:15 -0300 Subject: [PATCH 1/2] add html/css --- static/404.css | 12 ++++++++++++ templates/404.html | 17 +++++++++++------ templates/500.html | 14 ++++++++------ templates/rick.html | 1 + templates/start.html | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 static/404.css diff --git a/static/404.css b/static/404.css new file mode 100644 index 0000000..677f9a5 --- /dev/null +++ b/static/404.css @@ -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; +} \ No newline at end of file diff --git a/templates/404.html b/templates/404.html index 1b7afc7..a250ba1 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,10 +1,15 @@ + + + 404 Not Found + + + -

- 404. -

-

- Unexisting things cannot be found -

+
+ +

404

+

Unexisting things cannot be found

+ \ No newline at end of file diff --git a/templates/500.html b/templates/500.html index 78c5b52..eb86703 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,10 +1,12 @@ + -

- 500 -

-

- You asked for something dangerous -

+

+ 500 Bad Request +

+ + + + \ No newline at end of file diff --git a/templates/rick.html b/templates/rick.html index 394802b..b5b6778 100644 --- a/templates/rick.html +++ b/templates/rick.html @@ -1,5 +1,6 @@ + Test diff --git a/templates/start.html b/templates/start.html index efefad9..dd1785a 100644 --- a/templates/start.html +++ b/templates/start.html @@ -7,7 +7,7 @@ From 4d839f52bdc46405ae876a1aef09a9a3393dd3b8 Mon Sep 17 00:00:00 2001 From: jp Date: Mon, 29 Nov 2021 15:09:56 -0300 Subject: [PATCH 2/2] more stuff --- run.js | 12 +++++++++--- static/500.html | 12 ++++++++++++ static/style.css | 3 +++ static/test2.html | 8 ++++++++ static/uploadframe.html | 0 templates/start.html | 4 ++++ 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 static/500.html create mode 100644 static/style.css create mode 100644 static/test2.html create mode 100644 static/uploadframe.html diff --git a/run.js b/run.js index 9986384..880d05f 100644 --- a/run.js +++ b/run.js @@ -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("internal error"+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) { diff --git a/static/500.html b/static/500.html new file mode 100644 index 0000000..eb86703 --- /dev/null +++ b/static/500.html @@ -0,0 +1,12 @@ + + + +

+ 500 Bad Request +

+ + + + + + \ No newline at end of file diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..dc782b7 --- /dev/null +++ b/static/style.css @@ -0,0 +1,3 @@ +nav { + +} \ No newline at end of file diff --git a/static/test2.html b/static/test2.html new file mode 100644 index 0000000..78933be --- /dev/null +++ b/static/test2.html @@ -0,0 +1,8 @@ +
+
+

A heading here

+

Posted by John Doe

+

Some additional information here

+
+

Lorem Ipsum dolor set amet....

+
\ No newline at end of file diff --git a/static/uploadframe.html b/static/uploadframe.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/start.html b/templates/start.html index dd1785a..0c49bff 100644 --- a/templates/start.html +++ b/templates/start.html @@ -1,13 +1,17 @@ Upload something + + + +