URL Mapping - PSF1/pharinix GitHub Wiki

Router

The Pharinix URL router translate the URI query of user to command and parameters.

Static routing

User query: http://inicial.cloudapp.net/node/type/notes

Defined route: node/type/notes => command=pageToHTML&page=node_type_notes

Pharinix add $_POST["command"] and $_POST["page"] parameters.

Dynamic routing

Defined route: node/$type/$id/json => command=getNode&nodetype=$type&node=$id&interface=echoJson

User query 1: http://inicial.cloudapp.net/node/notes/3/json

User query 2: http://inicial.cloudapp.net/node/user/1/json

In each user query Pharinix search the best map and try to apply it. With de user query 1 it add the next parameters:

command=getNode nodetype=notes node=3 interface=echoJson

But, with the user query 2 it use the some map but add the next parameters:

command=getNode nodetype=user node=1 interface=echoJson