Created
November 20, 2021 11:30
-
-
Save tuergeist/55d634464851f1f7ad6aba2c72c4717e to your computer and use it in GitHub Desktop.
Lamdba envent handler serving an HTML file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
def handler_name(event, context): | |
with Path('web/index.html').open() as file: | |
html = file.read() | |
response = { | |
"statusCode": 200, | |
"body": html, | |
"headers": { | |
'Content-Type': 'text/html', | |
} | |
} | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment