feat(lander): PoC index pages

This commit is contained in:
Jef Roosens 2023-12-24 20:55:26 +01:00
parent 97d4008db2
commit f789847fc5
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
10 changed files with 189 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);
@ -58,6 +60,8 @@ lnm_http_step_err lander_remove_entry(lnm_http_conn *conn);
lnm_http_step_err lander_post_file(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.
*/