https://github.com/jnstockley/api
Custom API written in Python using FastAPI
https://github.com/jnstockley/api
api docker fastapi python rest
Last synced: about 2 months ago
JSON representation
Custom API written in Python using FastAPI
- Host: GitHub
- URL: https://github.com/jnstockley/api
- Owner: jnstockley
- License: gpl-3.0
- Created: 2024-02-09T04:39:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-30T01:56:49.000Z (2 months ago)
- Last Synced: 2026-04-30T02:27:01.327Z (2 months ago)
- Topics: api, docker, fastapi, python, rest
- Language: Python
- Homepage:
- Size: 1.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API
This is a custom API, written in Python using FastAPI, to help me accomplish tasks the can be improved through a RESTful API
## Setup
Simplest setup is to start from [compose.yml](https://github.com/jnstockley/api/blob/dev/compose.yml) and [template.env](https://github.com/jnstockley/api/blob/dev/template.env), which should be renamed to `.env`
### Environment Vairables
- `API_KEY` - Any long, random string. Keep this secret as this is the only form of authentication for the API. All routes require it, except `/health-check/`
- `DATABASE_URL` - The URL to connect to postgres DB. Must start with `postgresql+psycopg://`. Should be in the format specifiec in [template.env](https://github.com/jnstockley/api/blob/dev/template.env)
- `TZ` - Timezone of the container
- `PGTZ` - Timezone the Postgres container should use
## How to Access
Using the [compose.yml](https://github.com/jnstockley/api/blob/dev/compose.yml) file, you can access the API at `http://:5000/health-check`. If everything is setup correctly, you should see `{"status":"ok"}`