-
Notifications
You must be signed in to change notification settings - Fork 2
REQ
Jurek Muszyński edited this page Mar 28, 2024
·
15 revisions
Compares the first part of the request URI (resource) with string. 'First part' means everything until / or ?, for example:
URI | Catched by |
---|---|
/calc?first=2&second=3 |
REQ("calc") |
/customers/123 |
REQ("customers") |
/about.html |
REQ("about.html") |
Returns true if resource matches string, otherwise false.
// in npp_app_main
if ( REQ("calc") )
process_calc();
else if ( REQ("about") )
render_about();
else if ( REQ("") )
render_landing();
else
RES_STATUS(404);