feat(lander): PoC index pages

This commit is contained in:
Jef Roosens 2024-03-09 21:01:14 +01:00
parent 222b277eef
commit e91631dd42
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
10 changed files with 196 additions and 24 deletions

View file

@ -13,6 +13,7 @@ typedef struct lander_gctx {
lsm_store *store;
struct {
ltm_template *paste;
ltm_template *index;
} templates;
} lander_gctx;
@ -32,6 +33,7 @@ typedef enum lander_entry_type : uint8_t {
lander_entry_type_redirect = 0,
lander_entry_type_paste = 1,
lander_entry_type_file = 2,
lander_entry_type_index = 3,
} lander_entry_type;
void *lander_gctx_init();
@ -42,7 +44,7 @@ void lander_ctx_reset(lander_ctx *ctx);
void lander_ctx_free(lander_ctx *ctx);
lnm_http_step_err lander_get_index(lnm_http_conn *conn);
lnm_http_step_err lander_get_root(lnm_http_conn *conn);
lnm_http_step_err lander_get_entry(lnm_http_conn *conn);
@ -64,6 +66,8 @@ lnm_http_step_err lander_post_file(lnm_http_conn *conn);
lnm_http_step_err lander_post_file_secure(lnm_http_conn *conn);
lnm_http_step_err lander_post_index(lnm_http_conn *conn);
/**
* Store the requested header as an attribute, if it's present.
*/