Add a server setting for disabling the API key.

Useful for development if you want to disable API key authentication for
debugging the server without having to pull the generated key out of the
log every time.
This commit is contained in:
Dan Albert
2022-02-27 22:38:00 -08:00
parent 0056747aee
commit 4e348dd99a
2 changed files with 22 additions and 1 deletions

View File

@@ -22,6 +22,12 @@ class ServerSettings(BaseSettings):
# If you for some reason change the port, you'll need to also update map.js.
server_port: int = 5000
# Disable to allow requests to be made to the backend without an API key.
require_api_key: bool = True
# Enable to allow cross-origin requests from http://localhost:3000.
cors_allow_debug_server: bool = False
@classmethod
@lru_cache
def get(cls) -> ServerSettings: