repository
0.0.0-20240602055551-abf63dd06740
Repository: https://github.com/glizzus/trf.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
Totally Real Facts
Totally Real Facts is a parody website of Snopes.
Getting Started
Requirements
-
Go (Optional)
-
PostgreSQL (Optional)
Running with Docker Compose
docker-compose up --build
If you have Docker Compose 2.22.0 or later, you can develop with hot reload:
docker compose up --build --watch
Running with Go
Currently, running with Golang is cumbersome, but can be done with the following steps:
-
Install Go dependencies:
go mod download
-
Export environment variables:
# Postgres export MINISTRY_POSTGRES_HOST=localhost export MINISTRY_POSTGRES_USER=ministry export MINISTRY_POSTGRES_PASSWORD=ministry export MINISTRY_POSTGRES_DB=ministry # Spoofing export SPOOFER_TYPE=mock
-
Run the server:
go run cmd/ministry/main.go serve
Configuration
Environment Variables
-
Postgres
Name Description Required MINISTRY_POSTGRES_HOST
PostgreSQL host Yes MINISTRY_POSTGRES_USER
PostgreSQL user Yes MINISTRY_POSTGRES_PASSWORD
PostgreSQL password Yes MINISTRY_POSTGRES_DB
PostgreSQL database Yes MINISTRY_POSTGRES_PORT
PostgreSQL port No (default: 5432
) -
Spoofing
Name Description Required MINISTRY_SPOOFER_TYPE
Type of spoofer to use. Options are mock
, andopenai
Yes MINISTRY_OPENAI_KEY
OpenAI API key (required if MINISTRY_SPOOFER_TYPE
isopenai
)No
Endpoints
GET /latest
-
Description: Returns a HTML page cataloging the latest articles.
-
Response:
- Content-Type:
text/html
- Body: Click here to view the full HTML template
- Content-Type:
GET /{slug}
-
Description: Returns a HTML page for a specific article.
-
Response:
- Content-Type:
text/html
- Body: Click here to view the full HTML template
- Content-Type:
GET /healthz
-
Description: Returns a 200 status code if the server is healthy.
-
Response:
- Status Code:
200
- Status Code: