#define _POSIX_C_SOURCE 200809L #include "endpoints.h" #include "defs.h" #include #define LOGIN_BODY \ "
\n" \ " " PROJECT_NAME ", " \ PROJECT_DESC "\n" \ "
\n" \ "
\n" \ " \n" \ "
\n" \ " \n" \ "
\n" \ " \n" \ "
\n" int ep_login_get(const struct http_payload *const p, struct http_response *const r, void *const user) { static const char body[] = DOCTYPE_TAG "\n" " \n" " " STYLE_A "\n" " " COMMON_HEAD "\n" " \n" " " LOGIN_BODY "\n" "\n"; *r = (const struct http_response) { .status = HTTP_STATUS_OK, .buf.ro = body, .n = sizeof body - 1 }; if (http_response_add_header(r, "Content-Type", "text/html")) { fprintf(stderr, "%s: http_response_add_header failed\n", __func__); return -1; } return 0; }