Skip to content

Commit

Permalink
add initial source
Browse files Browse the repository at this point in the history
  • Loading branch information
h3xxx committed Feb 13, 2024
1 parent 4eeee7a commit e0083c3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ https://fastapi.tiangolo.com/
python -m pip install --upgrade pip
```

```bash
python -m pip install -r requirements-dev.txt
```

```bash
python -m pip install -r requirements.txt
```

## test / lint
```bash
pylint main.py
```

## run server
```bash
uvicorn main:app --reload
Expand Down
13 changes: 13 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
This is the main file for the FastAPI tutorial
"""
from typing import Union

from fastapi import FastAPI
Expand All @@ -7,9 +10,19 @@

@app.get("/")
def read_root():
"""
This is the root path
:return:
"""
return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
"""
This is the item path
:param item_id:
:param q:
:return:
"""
return {"item_id": item_id, "q": q}
8 changes: 8 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
version: "1.0"
linter: jetbrains/qodana-python-community:2023.3
#linter: jetbrains/qodana-python:2022.3-eap
bootstrap: |
rm -rf .idea
pip install -r requirements.txt --quiet
profile:
name: qodana.recommended
include:
- name: CheckDependencyLicenses
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
pylint==3.0.3

0 comments on commit e0083c3

Please sign in to comment.