INNER CODE UNIT · Python
read
rochacbruno/fastapi-project-template · project_name/app.py:12
def read(*paths, **kwargs):
"""Read the contents of a text file safely.
>>> read("VERSION")
"""
content = ""
with io.open(
os.path.join(os.path.dirname(__file__), *paths),
encoding=kwargs.get("encoding", "utf8"),
) as open_file:
content = open_file.read().strip()
return content
description = """
project_name API helps you do awesome stuff. 🚀
"""
app = FastAPI(