From b17f3164919f5dfdeee18e755645baa09a76f3f4 Mon Sep 17 00:00:00 2001 From: Charles Le Maux Date: Tue, 25 Jun 2024 23:51:48 +0100 Subject: [PATCH] [V2+] api_sender.html Signed-off-by: Charles Le Maux --- api_sender.html | 2 +- app.py | 2 +- generic_executor.py | 2 +- readme.md | 61 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 readme.md diff --git a/api_sender.html b/api_sender.html index 3c7ad05..296816d 100644 --- a/api_sender.html +++ b/api_sender.html @@ -100,7 +100,7 @@ document.addEventListener('DOMContentLoaded', () => { }); function sendRequest(endpoint, payload) { - return fetch(`http://localhost:3000/${endpoint}`, { + return fetch(`http://192.168.1.94:3000/${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/app.py b/app.py index 7e14882..88e79a2 100644 --- a/app.py +++ b/app.py @@ -108,4 +108,4 @@ def dynamic_route_handler(path): if __name__ == '__main__': - app.run(host='0.0.0.0', port=3000, debug=True) + app.run(host='0.0.0.0', port=3000, debug=False) diff --git a/generic_executor.py b/generic_executor.py index 27d16b0..41591f0 100644 --- a/generic_executor.py +++ b/generic_executor.py @@ -120,7 +120,7 @@ def account_delete(user: UserRecord, subdomain: str) -> tuple[HTTPStatus, str or except Exception as e: return HTTPStatus.NOT_FOUND, f"Database deletion failed | {e}" try: - file_manager.remove_stream_config() + file_manager.remove_stream_config(port, subdomain) except Exception as e: return HTTPStatus.INTERNAL_SERVER_ERROR, f"Nginx deletion failed. {str(e)}" return HTTPStatus.OK, f"Successfully deleted user {user_id}." diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..8dcfc88 --- /dev/null +++ b/readme.md @@ -0,0 +1,61 @@ +# Servii - Backend + +[![PyPI](https://img.shields.io/pypi/v/PyGithub.svg)](https://pypi.python.org/pypi/PyGithub) +![CI](https://github.com/PyGithub/PyGithub/workflows/CI/badge.svg) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) + +Servii is a cutting-edge project designed to streamline the management of Minecraft servers and facilitate seamless integration with frontend applications. +Built with modern technologies like [Firebase], Servii offers a robust backend for launching Minecraft servers and serves as a comprehensive API for frontend projects, enhancing the gaming experience through efficient server management and automation. +This [GitHub] repository has a production goal, workflows will be soon integrated. + +[Firebase]: https://firebase.google.com/ +[GitHub]: https://github.com + +## Installation guide +#### Download the repository. +```bash +git clone https://github.com/charleslemaux/servii-backend.git +cd servii-backend +``` +#### Install virtualenv. +```bash +pip3 install virtualenv +``` + +#### Enable it. +```bash +virtualenv venv + +//UNIX +source venv/bin/activate + +//windows +venv\Scripts\activate +``` +#### Install dependencies. +```bash +pip install -r requirements.txt +``` +#### Launch ! +```bash +gunicorn +``` + +## Documentation +The [documentation] isn't public yet. + +[documentation]: https://doc.servii.fr/back-end + +## Development + +### Contributing + +Long-term discussion and bug reports are maintained via GitHub Issues. +Code review is done via GitHub Pull Requests. + +### Maintainership + +We're actively seeking maintainers that will triage issues and pull requests and cut releases. +If you work on a project that leverages Servii and have a vested interest in keeping the code alive and well, send an email to [charles@le-maux.dev], thank you for reading. + +[charles@le-maux.dev]: charles@le-maux.dev \ No newline at end of file