Compare commits

..
1 Commits
Author SHA1 Message Date
retoor 40b8bd42fd Initial commit. 2024-12-05 19:34:58 +01:00
5 changed files with 8 additions and 9 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -1
View File
@@ -5,8 +5,10 @@ from rchat.app import create_app
def main(): def main():
app = create_app() app = create_app()
web.run_app(app, port=3018) web.run_app(app, port=8080)
# Run the server
if __name__ == "__main__": if __name__ == "__main__":
main() main()
# static/index.html
+5 -5
View File
@@ -33,11 +33,11 @@ class Application(BaseApplication):
ws = web.WebSocketResponse() ws = web.WebSocketResponse()
await ws.prepare(request) await ws.prepare(request)
session = request.session session = request.session
if "username" not in session: if not 'username' in session:
session["username"] = fake.name().split(" ")[0] session['username'] = fake.name().split(" ")[0]
session["uid"] = str(uuid.uuid4()) session['uid'] = str(uuid.uuid4())
session["session_id"] = session["uid"] session['session_id'] = session['uid']
username = session["username"] username = session["username"]
session_id = session["session_id"] session_id = session["session_id"]
uid = session["uid"] uid = session["uid"]
-3
View File
@@ -2,9 +2,6 @@
<html> <html>
<head> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>rchat</title> <title>rchat</title>
<style> <style>
body { body {