-
Notifications
You must be signed in to change notification settings - Fork 2
npp_app_main
Jurek Muszyński edited this page Mar 28, 2024
·
3 revisions
Called after parsing HTTP request header. This is the main entry point for a request.
None
void npp_app_main()
{
int ret=OK;
if ( REQ("login") )
{
render_login();
}
else if ( REQ("do_login") )
{
ret = npp_usr_login();
if ( ret != OK )
RES_LOCATION("login?msg=%d", ret);
else
RES_LOCATION("dashboard");
}
else if ( REQ("dashboard") )
{
render_dashboard();
}
else if ( REQ("") )
{
if ( LOGGED )
RES_LOCATION("dashboard");
else
render_landing();
}
else // page not found
{
RES_STATUS(404);
}
}