Config 1.1: URL

In Genelet, URL has the fixed format:


where HANDLER is handler name. A web project should use one and only one handler. role is name for group of visitors, e.g. public or member. Genelet supports user-account authentication and OAuth. mime is the mime type of pages, e.g. json, xml and html.  Switching mimes will turn a page from one mime format to another. For example, replacing html by json in the URL will bring you the JSON view of the same HTML page. component is an object name, usually mapping to a database table. Finally, action=string defines action (i.e. function, or object method) on the component. And query contains additional query parameters.

A web project will consist of many components and actions.

You may use the URL routing tool in Chapter 4.1 to customize URLs. But in most cases, you should stick with the fixed format URL principle.

By inspecting the URL, Genelet knows how to process authentication, which componenet to dispatch, and which data type should be returned back to visitor.

Comments are closed.