-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
72 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# TODO: Modify this Procfile to fit your needs | ||
web: hypercorn -b 0.0.0.0:$PORT app:rogue_scholar | ||
web: hypercorn -b 0.0.0.0:$PORT rogue_scholar_api:run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
class Config: | ||
SECRET_KEY = os.environ.get('SECRET_KEY') | ||
SUPABASE_URL = os.environ.get("SUPABASE_URL") | ||
SUPABASE_ANON_KEY = os.environ.get("SUPABASE_ANON_KEY") | ||
TYPESENSE_API_KEY = os.environ.get("TYPESENSE_API_KEY") | ||
TYPESENSE_HOST = os.environ.get("TYPESENSE_HOST") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from rogue_scholar_api import app | ||
import pytest # noqa: F401 | ||
import pytest_asyncio # noqa: F401 | ||
|
||
pytestmark = pytest.mark.asyncio | ||
|
||
|
||
async def test_index_route(): | ||
test_client = app.test_client() | ||
response = await test_client.get("/") | ||
assert response.status_code == 200 | ||
result = await response.data | ||
print(result) | ||
assert result == b"This is the Rogue Scholar API." | ||
|
||
|
||
async def test_blogs_route(): | ||
test_client = app.test_client() | ||
response = await test_client.get("/blogs") | ||
assert response.status_code == 200 | ||
result = await response.get_json() | ||
assert len(result) == 60 | ||
assert result[0]["title"] == "A blog by Ross Mounce" | ||
assert result[0]["slug"] == "rossmounce" |