From 75ced388a61f0f1e4b88765d09c3251748734fea Mon Sep 17 00:00:00 2001 From: grant-kun Date: Mon, 10 Oct 2022 20:27:41 -0500 Subject: added 404 --- html/404.html | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.ts | 34 +++++++----- readme.md | 1 + 3 files changed, 196 insertions(+), 15 deletions(-) create mode 100644 html/404.html diff --git a/html/404.html b/html/404.html new file mode 100644 index 0000000..0e18290 --- /dev/null +++ b/html/404.html @@ -0,0 +1,176 @@ + + + + + + + + + + +
+ 404418
i am infact a teapot
+

+ +
+
+
+
+
+ + + + +
+ either i dont know this page, or i cant give it to you! no hard feelings + i hope! + +
+ what could it be? + 400,401,403,404,405,408,429 (or 500-511 for server fault) +
what is it not? 402 + & + 200-299 (duh) +
+ +
+
+ + + + + +
+ +
+ + \ No newline at end of file diff --git a/index.ts b/index.ts index e442a6b..4acccd4 100644 --- a/index.ts +++ b/index.ts @@ -92,21 +92,9 @@ app.get('/mail', (req:any, res:any) => { res.sendFile(__dirname+'/html/mail.html') }) -//http -var httpServer = http.createServer(app); -var credentials = {key: privateKey, cert: certificate}; -var httpsServer = https.createServer(credentials, app); -app.listen(8080,()=>{ - log(`kanna is local http://${ip.address()}:8080`) -}) -httpServer.listen(80, () => { - log(`kanna is on http://${ip.address()} click on me click on me! :3`) -}) -httpsServer.listen(443, () => { - log(`kanna is secure now too!! https://${ip.address()}`) -}) -//end + app.get('/', (req:any, res:any) => { + console.log('test') res.sendFile(__dirname+"/html/index.html") }) app.get('/kanna.txt', (req:any, res:any) => { @@ -157,7 +145,23 @@ app.post('/login/submit', async (req:{body:{json:boolean,enc:boolean,data:string } } }) - +app.use((req:any, res:any, next:any) => { + res.status(418).sendFile(__dirname+'/html/404.html') +}) +//http +var httpServer = http.createServer(app); +var credentials = {key: privateKey, cert: certificate}; +var httpsServer = https.createServer(credentials, app); +app.listen(8008,()=>{ + log(`kanna is local http://${ip.address()}:8080`) +}) +httpServer.listen(80, () => { + log(`kanna is on http://${ip.address()} click on me click on me! :3`) +}) +httpsServer.listen(443, () => { + log(`kanna is secure now too!! https://${ip.address()}`) +}) +//end /*let l = (encrypt(JSON.stringify({ 'emails':[{ 'address':'grantsquires@disroot.org', diff --git a/readme.md b/readme.md index 7f90be8..8c6a78c 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,7 @@ visit the [main git](https://git.disroot.org/grantsquires/kanna-site) or the [gi - [ ] login - [ ] performance related - [ ] store all listeners in array and kill + - [ ] go through all html files, clean up code ## currently -- cgit v1.2.3