Skip to content

platformsh-templates/fastapi

Repository files navigation

Warning

This repository is no longer maintained by our internal teams.
The template is provided as is and will not receive updates, bug fixes, or new features.
You are welcome to contribute on it or fork the repository and modify it for your own use. To deploy this template on Upsun, you can use the command upsun project:convert on this codebase to convert the existing .platform.app.yaml configuration file to the Upsun Flex format.

FastAPI for Platform.sh

This template demonstrates building the FastAPI framework for Platform.sh. It includes a minimalist application skeleton that demonstrates how to connect to a MariaDB server for data storage and Redis for caching. The application starts as a bare Python process with no separate runner. It is intended for you to use as a starting point and modify for your own needs.

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.

Features

  • Python 3.11
  • MariaDB 10.4
  • Redis 5.0
  • Automatic TLS certificates
  • Pipfile-based build

Customizations

The following files have been added to a basic FastAPI configuration. If using this project as a reference for your own existing project, replicate the changes below to your project.

  • The .platform.app.yaml, .platform/services.yaml, and .platform/routes.yaml files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit.
  • A rudimentary application is included in server.py for demonstration purposes. It shows the basic process of starting the server and connecting to the MariaDB database. Modify and replace it as desired.

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7