mirror of
https://github.com/Llloooggg/TextSouls.git
synced 2026-03-06 12:36:23 +03:00
22 lines
509 B
Python
22 lines
509 B
Python
import json
|
|
import requests
|
|
|
|
with open("textsouls/config.json") as config_file:
|
|
config_data = json.load(config_file)
|
|
|
|
|
|
class Backend:
|
|
base_url = config_data["backend_settings"]["base_url"]
|
|
|
|
def post(self, relative_url, data):
|
|
try:
|
|
response = requests.post(
|
|
f"{self.base_url}{relative_url}", json=data
|
|
)
|
|
return {"error": None, "response": response}
|
|
except Exception as err:
|
|
return {"error": err}
|
|
|
|
|
|
backend = Backend()
|