Skip to content

tessavdheiden/simplest-api

Repository files navigation

Application with FastAPI

This is the simplest api one can think of, but can be used to make one specific for you application.

Setup

Create conda environment with dependencies:

> conda env create -f environment.yml
> conda activate fast_api_app

How it works

Launch app:

> uvicorn main:app --reload

In a seperate terminal:

> python sample_request.py

Modify:

> autopep8 --in-place --aggressive --aggressive [script_name].py

Connecting to Heroku, create an app with a specific name and to specify it as Python app:

> heroku create [name-of-app] --buildpack heroku/python

Create another remote on Heroku:

> heroku git:remote --app [name-of-app]

Optionally, check if the remote is there:

> git remote -v

Lauch the app:

> git push heroku main

Now we can check out the app at https://[name-of-app].herokuapp.com/

Optionally, enter into the Heroku VM using:

> heroku run bash --app [name-of-app]

Run tests:

> pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published