added README.md
This commit is contained in:
18
README.md
Normal file
18
README.md
Normal 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
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user