Config 1.1: URL

In Genelet, URL always follows this format:

http://WEBSITE/HANDLER/role/mime/component?action=string&query...

where HANDLER is handler name. A web project should use only one handler. role is name for group of visitors like public or member. Genelet supports user-account authentication and OAuth (both OAuth 1 and 2). mime is the mime type of page like json, xml and html.  You can switch a HTML page to JSON API by changing html to json in URL. component is an object name, usually mapping to a database table. Finally, action=string defines a action or class method on the component. A web project will consist of many components and actions.

You may use the URL rerouting tool in Chapter 4.1 to customize URLs.

By inspecting the URL, Genelet knows how to process authentication, where to dispatch the request for future process, and which data type should be returned back to visitor. It is important to understand ans stick with the URL format.

Comments are closed.