Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
clean up the file and folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnusyawall authored and PrimalPimmy committed Oct 10, 2022
1 parent 3abe900 commit 083f449
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Usual Express and Socket.IO stuff
require("dotenv").config();
require("./database/conn");
const bcrypt = require("bcrypt");
const express = require("express");
let favicon = require("serve-favicon");
Expand All @@ -9,7 +10,6 @@ const cookieParser = require("cookie-parser");
const server = http.createServer(app);
const { Server } = require("socket.io");
const io = new Server(server);
require("./database/conn");
const { requireauth } = require("./middleware/auth");
const jwt = require("jsonwebtoken");
const Message = require("./database/registers");
Expand Down Expand Up @@ -95,19 +95,19 @@ app.get("*", checkuser);
app.get("/", requireauth, (req, res) => {
userentered = user1.username;
useremail = user1.email;
res.sendFile(__dirname + "/index.html");
res.sendFile(__dirname + "/views/index.html");
});

app.get("/ui", requireauth, (req, res) => {
userentered = user1.username;
useremail = user1.email;
res.sendFile(__dirname + "/old.index.html");
res.sendFile(__dirname + "/tmp/old.index.html");
});


//handling signup
app.get("/signup", (req, res) => {
res.sendFile(__dirname + "/signup.html");
res.sendFile(__dirname + "/views/signup.html");
});

//handling sign post request
Expand Down Expand Up @@ -147,7 +147,7 @@ app.post("/signup", async (req, res) => {
//handling login

app.get("/login", (req, res) => {
res.sendFile(__dirname + "/login.html");
res.sendFile(__dirname + "/views/login.html");
});

app.post("/login", async (req, res) => {
Expand Down Expand Up @@ -244,7 +244,7 @@ app.post("/otp", async (req, res) => {
}
});
app.get("/forgotpassword", (req, res) => {
res.sendFile(__dirname + "/fpassword.html");
res.sendFile(__dirname + "/views/fpassword.html");
});


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fpassword.html → views/fpassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/login.css" />
<link rel="stylesheet" href="/css/login.css" />
<title>Reset Password</title>
</head>
<body>
Expand Down
8 changes: 4 additions & 4 deletions index.html → views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatApp</title>
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/css/style.css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
Expand All @@ -28,7 +28,7 @@
<div>
<div class="rounded-3 py-3 px-2 d-flex justify-content-between flex-column details-bg shadow-sm border-1">
<div>
<img src='/chatApplogo.png' height="50" width="50" alt='chatapp-logo'>
<img src='/img/chatApplogo.png' height="50" width="50" alt='chatapp-logo'>
<h2 class="text-custom"> CHAT APP </h2>
<div class="d-flex justify-content-center mt-4 mb-3 w-100">
<p class="text-break"><b><span id="username_holder"></span>, <span id="email_holder" class="text-primary text-decoration-underline"></span></a></b></p>
Expand Down Expand Up @@ -74,6 +74,6 @@ <h2 class="text-custom"> CHAT APP </h2>
</div>
</div>
<script src="/socket.io/socket.io.js"></script>
<script src="/client.js"></script>
<script src="/js/client.js"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion login.html → views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/login.css" />
<link rel="stylesheet" href="/css/login.css" />
<title>Login</title>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion signup.html → views/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/login.css" />
<link rel="stylesheet" href="/css/login.css" />
<title>Signup</title>
</head>
<body>
Expand Down

0 comments on commit 083f449

Please sign in to comment.