Skip to content

Debug

Debug (atlas.debug) is the package containing the local debugging server script: server.py.

Server

Atlas local debugging server script.

This file should not be imported anywhere, except for inside the API's .atlas/debug.py file.

The logic stored here was built to locally simulate an API deployment to the AWS environment while allowing the developer to be able to make HTTP requests to localhost:8080 to test the application without actually needing to deploy via the CDK.

Notes
  • This script is strictly written to work with .atlas/debug.py in VSCode (F5 key).
  • Compared to a real deployment, some logics have been adapted as faithfully as possible, but may differ in several aspects.
  • Infrastructure settings (such as memory, SnapStart usage, and others) will not take effect in this local environment.
  • During debugging, some interactions with AWS may still be necessary (such as using the secret ARN that stores environment variables, reading and writing DynamoDB tables, etc.).
Example
# .atlas/debug.py

from atlas.debug import server

# Runs the debug server at the provided port. Use "use_local=True" if you are locally developing atlas-fw (editable) in a neighboring folder.
server.run_server(port=8080, use_local=True)