An open API service indexing awesome lists of open source software.

https://github.com/nhymxu/flask-boilerplate

A boilerplate Flask RESTful API
https://github.com/nhymxu/flask-boilerplate

flask hacktoberfest poetry python

Last synced: 3 months ago
JSON representation

A boilerplate Flask RESTful API

Awesome Lists containing this project

README

          

# flask-boilerplate

## Install

### for dev & test

```shell
uv sync --all-groups
```

### Production

```shell
uv sync --no-group dev
uv sync --no-group dev --group production
uv sync --group production
```

## Local run

```shell
flask --app web run
# or
FLASK_APP=web flask run
```

## Lint

```shell
ruff check .
```

## Deploy

synchronize: Gunicorn
async: Hypercorn/uvcorn

```shell
pip install "uvicorn[standard]" gunicorn
````

Note: on MacOS. Run this command to fix gunicorn error

```shell
export NO_PROXY=*
```

```shell
hypercorn web:asgi_app

uvicorn web:asgi_app --host 0.0.0.0 --port 80

gunicorn web:asgi_app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80
```