Skip to content

Commit

Permalink
Enable catalog page
Browse files Browse the repository at this point in the history
  • Loading branch information
AsgerPetersen committed Jul 7, 2021
1 parent 2efc2bf commit 1656954
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyqgisserver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def load_configuration():
CONFIG.set('server', 'ssl_key' , getenv('QGSRV_SERVER_SSL_KEY' , ''))
CONFIG.set('server', 'cross_origin' , getenv('QGSRV_SERVER_CROSS_ORIGIN' , 'yes'))
CONFIG.set('server', 'status_page' , getenv('QGSRV_SERVER_STATUS_PAGE' , 'no'))
CONFIG.set("server", "landing_page", getenv("QGSRV_LANDING_PAGE", "no"))
CONFIG.set("server", "landing_page_prefix", getenv("QGIS_SERVER_LANDING_PAGE_PREFIX", "/catalog"))

CONFIG.add_section('logging')
CONFIG.set('logging', 'level', getenv('QGSRV_LOGGING_LEVEL', 'DEBUG'))
Expand Down
6 changes: 6 additions & 0 deletions pyqgisserver/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ def add_handler( path, handler, kwargs ):

add_handler( rf"{root}(?P<endpoint>/wfs3/conformance{end})", OwsHandler, ows_kwargs )
add_handler( rf"{root}(?P<endpoint>/wfs3/api{end})", OwsHandler, ows_kwargs )

# Landing page
if cfg.getboolean("landing_page"):
prefix = cfg.get("landing_page_prefix").strip("/")
# Use OwsHandler (acts more like a generic QgisHandler here)
add_handler(rf"/{prefix}/.*", OwsHandler, ows_kwargs)

return handlers

Expand Down

0 comments on commit 1656954

Please sign in to comment.