added README.md

This commit is contained in:
slawk0
2024-08-24 01:44:40 +02:00
parent bb626f4deb
commit 8fce5a44c3
4 changed files with 24 additions and 13 deletions

18
README.md Normal file
View File

@@ -0,0 +1,18 @@
Web chat (not finished!)
========================
Web chat application using Express.js, Socket.io, Postgresql, and JWT for user authentication .
Selfhost:
1. **Clone repository:**
```bash
git clone https://github.com/slawk0/web-chat
2. **Move to directory**
```bash
cd web-chat
3. **Install dependencies**
```bash
npm i
4. **Run the server**
```bash
node index.js

View File

@@ -10,16 +10,15 @@ function showPasswd() {
}
}
document.getElementById('signupForm').addEventListener('submit', function (event) {
document.getElementById('signupForm').addEventListener('submit',async function (event) {
event.preventDefault();
const password = document.getElementById("password").value;
const sPassword = document.getElementById("sPassword").value;
console.log(password, sPassword);
if(password !== sPassword){
alert("Passwords don't match!");
event.preventDefault();
} else {
this.submit();
}
});
})

View File

@@ -18,21 +18,15 @@
</head>
<body>
<h1>Web chat</h1>
<ul id="messages"></ul>
<form id="form" action="">
<input id="input" autocomplete="off" placeholder="Enter message" />
<input id="input" autocomplete="off" placeholder="Enter message"/>
<button>Send</button>
</form>
<!--<form id="recipmentForm" action="">-->
<!-- <input id="recipmentInput" autocomplete="off" />-->
<!-- <button>Send</button>-->
<!--</form>-->
<script src="/socket.io/socket.io.js"></script>
<script src="/static/js/signup.js"></script>
<script src="/static/js/chat.js"></script>
</body>
</html>

View File

@@ -18,7 +18,7 @@
<label for="username"></label>
<input type="text" name="username" placeholder="Username" id="username" required>
<label for="password"></label><br>
<label for="password"></label>
<input type="password" name="password" placeholder="Password" id="password" required>
<input type="checkbox" onclick="showPasswd()">Show Password