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

Commit

Permalink
Backend refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
deminearchiver committed Nov 23, 2024
1 parent 3c14d31 commit 72b25c9
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

node_modules/
.venv
__pycache__
package-lock.json
*.db

dist
dist-ssr
Expand Down
Binary file removed apps/backend/db.db
Binary file not shown.
6 changes: 5 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"private": true,
"name": "@cgs/backend",
"type": "module",
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"scripts": {
"dev": "py src/dev.py",
"start": "py src/prod.py"
}
}
2 changes: 1 addition & 1 deletion apps/backend/app.py → apps/backend/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from flask import Flask, request, make_response
from flask_cors import CORS, cross_origin

from apps.backend import util
import util
from db import DB
from events import events

Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions apps/backend/src/dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from app import app

if __name__ == '__main__':
app.run(debug=True, host='127.0.0.1', port=5000)

File renamed without changes.
5 changes: 5 additions & 0 deletions apps/backend/src/prod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from app import app

if __name__ == '__main__':
from waitress import serve
serve(app, host='0.0.0.0', port=8080)
4 changes: 2 additions & 2 deletions apps/backend/util.py → apps/backend/src/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from apps.backend.classes import Event
from apps.backend.db import HISTORY_EVENT_SEP, HISTORY_ANSWER_SEP
from classes import Event
from db import HISTORY_EVENT_SEP, HISTORY_ANSWER_SEP
from events import events


Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 72b25c9

Please sign in to comment.