Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.08 KB

Routes.textile

File metadata and controls

27 lines (20 loc) · 1.08 KB

Routing System

The routing system is simple, in the file boss.routes you have some special routes and free-hand named routes, the routes are loaded at startup in memory (ets table) and reloaded on /admin/upgrade.

The file contains a list of erlang terms, one per line finished with a dot.

  • boss.routes example

% Routes file.

% Formats: 
%     {"/some/route", [{controller, "Controller"}, {action, "Action"}]}.
%     {"/some/route", [{controller, "Controller"}, {action, "Action"}, {id, "42"}]}.
%     {"/some/route", [{application, some_app}, {controller, "Controller"}, {action, "Action"}, {id, "42"}]}.
%     {404, [{controller, "Controller"}, {action, "Action"}]}.
%     {404, [{controller, "Controller"}, {action, "Action"}, {id, "42"}]}.
%     {404, [{application, some_app}, {controller, "Controller"}, {action, "Action"}, {id, "42"}]}.
%
% Note that routing across applications results in a 302 redirect.

% Front page
% {"/", [{controller, "world"}, {action, "hello"}]}.

% 404 File Not Found handler
% {404, [{controller, "world"}, {action, "lost"}]}.