aboutsummaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authorgrant-kun <[email protected]>2022-10-10 20:27:41 -0500
committergrant-kun <[email protected]>2022-10-10 20:27:41 -0500
commit75ced388a61f0f1e4b88765d09c3251748734fea (patch)
tree68becd23a9af74e11a8696adab2a8e3a2d6f3191 /index.ts
parent5bc1f63580b5724cd702bd6fdef71ca3789b209b (diff)
added 404
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts34
1 files changed, 19 insertions, 15 deletions
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':'[email protected]',