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.

42 lines
826 B
C

#include "owner.h"
#include "http_server/http_request.h"
#include <stdio.h>
static void write_public_key( FILE* f )
{
FILE* pubkey = fopen( "data/owner/public.pem", "r" );
char ch;
while( (ch = fgetc(pubkey)) != EOF ) {
if( ch == '\n' ) {
fprintf( f, "\\n" );
} else {
fputc(ch,f);
}
}
}
static void handle_owner_actor( struct http_request* req )
{
const char* server = "apogee.polaris-1.work";
struct account* owner_account = account_from_id(0);
http_request_send_headers( req, 200, "application/activity+json", true );
FILE* f = http_request_get_response_body(req);
#define RENDER
#include "src/view/owner_actor.json.inc"
#undef RENDER
}
bool route_owner( struct http_request* req )
{
if( http_request_route( req, "/actor" ) ) {
handle_owner_actor(req);
return true;
}
return false;
}