Skip to content

Commit

Permalink
Move env vars out of justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-mazzone committed Dec 2, 2024
1 parent 18b8660 commit 3d1e5ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
12 changes: 1 addition & 11 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
export MB__BATCH_SIZE := "10_000"
export MB__BACKEND_TYPE := "postgres"
export MB__DATASETS_CONFIG := "datasets.toml"
export MB__POSTGRES__HOST := "localhost"
export MB__POSTGRES__PORT := "5432"
export MB__POSTGRES__USER := "matchbox_user"
export MB__POSTGRES__PASSWORD := "matchbox_password"
export MB__POSTGRES__DATABASE := "matchbox"
export MB__POSTGRES__DB_SCHEMA := "mb"

# Make datasets table
matchbox:
uv run python src/matchbox/admin.py --datasets datasets.toml
Expand All @@ -29,4 +19,4 @@ test:

# Run development version of API
api:
uv run fastapi dev src/matchbox/server/api.py
uv run fastapi dev src/matchbox/server/api.py
6 changes: 6 additions & 0 deletions src/matchbox/server/api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from enum import StrEnum
from typing import Annotated

from dotenv import find_dotenv, load_dotenv
from fastapi import Depends, FastAPI, HTTPException
from pydantic import BaseModel

from matchbox.server.base import BackendManager, MatchboxDBAdapter

dotenv_path = find_dotenv(usecwd=True)
load_dotenv(dotenv_path)


app = FastAPI(
title="matchbox API",
version="0.1.0",
Expand Down Expand Up @@ -45,6 +50,7 @@ def get_backend() -> MatchboxDBAdapter:

@app.get("/health")
async def healthcheck() -> HealthCheck:
""" """
return HealthCheck(status="OK")


Expand Down

0 comments on commit 3d1e5ea

Please sign in to comment.