Skip to content

silgy_app_main

Jurek Muszyński edited this page Apr 9, 2019 · 2 revisions

void silgy_app_main(int ci)

Description

Called after parsing HTTP request header. This is the main entry point for a request.

Returns

None

Example

void silgy_app_main(int ci)
{
    int ret=OK;

    if ( REQ("login") )
    {
        gen_page_login(ci);
    }
    else if ( REQ("do_login") )
    {
        ret = silgy_usr_login(ci);
        if ( ret != OK )
            RES_LOCATION("login?msg=%d", ret);
        else
            RES_LOCATION("dashboard");
    }
    else if ( REQ("dashboard") )
    {
        gen_page_dashboard(ci);
    }
    else if ( REQ("") )
    {
        if ( LOGGED )
            RES_LOCATION("dashboard");
        else
            gen_page_landing(ci);
    }
    else  // page not found
    {
        RES_STATUS(404);
    }
}
Clone this wiki locally