You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
689 B
C
32 lines
689 B
C
#include "nodeinfo.h"
|
|
|
|
#include "http/server/request.h"
|
|
#include "model/server.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
bool route_wellknown_nodeinfo( struct http_request* req )
|
|
{
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
FILE* f = http_request_get_response_body(req);
|
|
#define RENDER
|
|
#include "src/view/nodeinfo.json.inc"
|
|
#undef RENDER
|
|
return true;
|
|
}
|
|
bool route_nodeinfo( struct http_request* req )
|
|
{
|
|
if( http_request_route( req, "/2.1" ) ) {
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
FILE* f = http_request_get_response_body(req);
|
|
#define RENDER
|
|
#include "src/view/nodeinfo_2_1.json.inc"
|
|
#undef RENDER
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|