diff --git a/app.py b/app.py new file mode 100644 index 0000000..5586b59 --- /dev/null +++ b/app.py @@ -0,0 +1,20 @@ +from fastapi import FastAPI, Request, HTTPException +import json + +app = FastAPI() + +@app.post("/endpoint") +async def receive_info(request: Request): + # Lire le body brut + body = await request.body() + print(body) + + # Parser le JSON + try: + data = json.loads(body) + except json.JSONDecodeError: + raise HTTPException(status_code=400, detail="Invalid JSON") + + # Debug + print("Infos recues :", data) + return {"status": "ok"} \ No newline at end of file diff --git a/grabber.sh b/grabber.sh index 9805485..5b5a5a9 100755 --- a/grabber.sh +++ b/grabber.sh @@ -283,12 +283,11 @@ json_file() { '{ HARDWARE: { hostname:$hostname, - mb_serial:$mb_serial, - chassis_serial:$chassis_serial, - cpu:$cpu, + mb_serial:$motherboard, + cpu_model:$cpu_model, cpu_id:$cpu_id, - cpu_cores_number:$cpu_cores_number, - cpu_threads_number:$cpu_threads_number, + cpu_cores:$cpu_cores, + cpu_threads:$cpu_threads, cpu_frequency_min:$cpu_frequency_min, cpu_frequency_cur:$cpu_frequency_cur, cpu_frequency_max:$cpu_frequency_max, diff --git a/readme.md b/readme.md index 8cc512c..fa895fd 100644 --- a/readme.md +++ b/readme.md @@ -13,11 +13,4 @@ Grabber is a bash program that fetch some informations of the computer like memo - v0 : grabber base, works minimal, ask permission, needs upgrades and rework # Credits -Logo inspired by [kawaiiLogos](https://github.com/SAWARATSUKI/KawaiiLogos) project - -python3 -m venv gbvenv - 182 source gbvenv/bin/activate - 183 pip install --upgrade pip - 184 python -m pip install fastapi - 185 pip freeze >> requirements.txt - 186 echo ¨gbvenv¨ >> .gitignore +Logo inspired by [kawaiiLogos](https://github.com/SAWARATSUKI/KawaiiLogos) project \ No newline at end of file