This commit is contained in:
Ramzi Idir 2026-01-15 23:25:46 +01:00
parent 84489675ba
commit f472de1a1d
3 changed files with 25 additions and 13 deletions

20
app.py Normal file
View File

@ -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"}

View File

@ -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,

View File

@ -14,10 +14,3 @@ Grabber is a bash program that fetch some informations of the computer like memo
# 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