Fix broken http mode (crash at init)

revert changes from previous commit in dev
This commit is contained in:
jonny_jr9 2023-08-30 08:58:32 +02:00
parent 3722b0af74
commit 59a4f8c13f

View File

@ -232,18 +232,21 @@ void http_init_server()
//----- define URLs ----- //----- define URLs -----
httpd_uri_t joystick_url; //note: dont use separate assignment of elements because causes controller crash
joystick_url.uri = "/api/joystick"; httpd_uri_t joystick_url = {
joystick_url.method = HTTP_POST; .uri = "/api/joystick",
joystick_url.handler = on_joystick_url; .method = HTTP_POST,
.handler = on_joystick_url,
};
httpd_register_uri_handler(server, &joystick_url); httpd_register_uri_handler(server, &joystick_url);
httpd_uri_t default_url; httpd_uri_t default_url = {
default_url.uri = "/*"; .uri = "/*",
default_url.method = HTTP_GET; .method = HTTP_GET,
default_url.handler = on_default_url; .handler = on_default_url};
httpd_register_uri_handler(server, &default_url); httpd_register_uri_handler(server, &default_url);
//previous approach with sockets: //previous approach with sockets:
// httpd_uri_t socket_joystick_url = { // httpd_uri_t socket_joystick_url = {
// .uri = "/ws-api/joystick", // .uri = "/ws-api/joystick",