|
|
|
@ -200,10 +200,20 @@ bool route_mastodon_api( struct http_request* req )
|
|
|
|
|
} else if( http_request_route( req, "timelines/public" ) ) {
|
|
|
|
|
return handle_timeline( req, tli_public );
|
|
|
|
|
} else if( http_request_route( req, "instance" ) ) {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
#include "src/view/api/instance_data.json.inc"
|
|
|
|
|
return true;
|
|
|
|
|
if( http_request_route_term( req, "/peers" ) ) {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
fprintf( f, "[" );
|
|
|
|
|
fprintf( f, "\"poa.st\"" );
|
|
|
|
|
// TODO: print peers
|
|
|
|
|
fprintf( f, "]" );
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
#include "src/view/api/instance_data.json.inc"
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else if( http_request_route_term( req, "custom_emojis" ) ) {
|
|
|
|
|
return route_custom_emojis(req);
|
|
|
|
|
} else if( http_request_route( req, "statuses" ) ) {
|
|
|
|
|