Skip to content

Latest commit

 

History

History
24 lines (12 loc) · 1.08 KB

PREFIXES.md

File metadata and controls

24 lines (12 loc) · 1.08 KB

Controller Prefixes

The controller prefix is a module search path that tells Endpoints where you have defined all your Controllers.

Endpoints will only route to Controllers defined in these prefixes. If no prefixes are defined Endpoints will check the current working directory for an importable controllers module.

Defining Controller prefixes

Define controller prefixes is to set the environment variable ENDPOINTS_PREFIX, for example:

$ export ENDPOINTS_PREFIX=controllers

Now, when Endpoints is started it would route to any Controller class found in the controllers python module.

Multiple Controller Prefixes

You can define multiple controller prefixes through the environment also:

$ export ENDPOINTS_PREFIX_1=foo.controllers
$ export ENDPOINTS_PREFIX_2=bar.controllers

Endpoints will check ENDPOINTS_PREFIX_1 through ENDPOINTS_PREFIX_N as long as there is no break (ie, you can't set ENDPOINTS_PREFIX_1 and then ENDPOINTS_PREFIX_3 and expect ENDPOINTS_PREFIX_3 to be found).