You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »



Global

Starting with a reminder, the configuration file is a .py file, which means you can code in it, making a more dynamic configuration, and that’s what we did.

Starting top to bottom:

  1. Imports for the utility function used on the configuration creation
  2. Environment variables, just to show how the loading of Docker variables can be done.
  3. Declaration of the SERVER_PATH to be used in relative paths, later on

Server Address and Workers

Over here we start the actual configuration, and addressing the elephant in the room… Yes the configuration is in a variable CONFIG, which is a dictionary.

  • Host
    • Listening address of the server, by default 0.0.0.0, meaning listening to all request
  • Port
    • Listening port, by default 8085
  • Workers:
    • Number of webapp instances to start up in the server
    • Applicable only when using the provided uvicorn server
    • If using default server, the workers should be set according to the project needs

CORS

CORS (Cross-Origin Resource Sharing), controls the access to reasources for external request.

  • Allow Origins:
    • List of domains allow to make request to the server
  • Allow Credentials:
    • Allow credential header to be on the request
  • Allow Methods
  • Alllow Headers
  • Expose Headers
    • indicates which headers should be made available to scripts running in the browser


* means all

Logging

Logging options for the entire server, from the message format, date format to handlers

  • Message Formart (msgFormat)
  • Date Format
  • Level
    • Default message level, to report to the handlers
  • Handlers: Logs destinations
    • File
    • Console
    • NonSQL
      • Non-SQL starts recording after the connection to the engine was made
  • Loggers
    • Set the log level for specific loggers









  • No labels