14 lines
1.0 KiB
Plaintext
14 lines
1.0 KiB
Plaintext
In SPARC, the app menu is created from app/assets/json/global/app-menu-map.json
|
|
Each entry defines a route.
|
|
A "high level" route is then configured in app/config/baseRoutes.json that delegates a group of URLs to a controller.
|
|
Then, a controller, in its associated .json file defines in its "routes" section the sub-route managed by the controller,
|
|
and the method to be called inside that controller.
|
|
|
|
In SPARC, models inherit from the core and from WindozModel a mecanism that gets the URL from app/assets/json/global/services.json
|
|
That configuration file associates actions grouped in sections to API urls and http method.
|
|
Sections are identified by an URL-prefix (only used as label), and correspond to API "services".
|
|
The server-side of this API is served by the node daemon in p42api.
|
|
p42api has a folder 'api' with one file / module per API service, they are all declared in and imported by api/index.js.
|
|
Each module defines a mapping object, that contains all the complete urls served, http-method, and local handling method.
|
|
|