1
Fork 0
mirror of https://github.com/RGBCube/GDUS synced 2025-07-28 13:37:45 +00:00
This commit is contained in:
RGBCube 2023-12-21 18:39:55 +03:00
parent e69cec1b40
commit eb584e3bf1
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View file

@ -15,6 +15,7 @@ app = FastAPI()
@app.get("/led/toggle")
async def toggle() -> str:
global led_state
led_state = not led_state
gpio.output(LED_PIN, int(led_state))
@ -22,7 +23,7 @@ async def toggle() -> str:
@app.get("/speak")
async def speak(text: str) -> str:
ret = os.system(f'text2speech "{text}""')
ret = os.system(f'text2speech "{text}"')
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";

View file

@ -40,7 +40,7 @@ async fn main() -> io::Result<()> {
.service(submit::submit_form)
.service(view::view)
})
.bind(("0.0.0.0", 80))?
.bind(("0.0.0.0", 8080))?
.run()
.await
}