Categorygithub.com/glizzus/trf
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

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:

  1. Install Go dependencies:

    go mod download
    
  2. 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
    
  3. Run the server:

    go run cmd/ministry/main.go serve
    

Configuration

Environment Variables

  • Postgres

    NameDescriptionRequired
    MINISTRY_POSTGRES_HOSTPostgreSQL hostYes
    MINISTRY_POSTGRES_USERPostgreSQL userYes
    MINISTRY_POSTGRES_PASSWORDPostgreSQL passwordYes
    MINISTRY_POSTGRES_DBPostgreSQL databaseYes
    MINISTRY_POSTGRES_PORTPostgreSQL portNo (default: 5432)
  • Spoofing

    NameDescriptionRequired
    MINISTRY_SPOOFER_TYPEType of spoofer to use. Options are mock, and openaiYes
    MINISTRY_OPENAI_KEYOpenAI API key (required if MINISTRY_SPOOFER_TYPE is openai)No

Endpoints

GET /latest

GET /{slug}

GET /healthz

  • Description: Returns a 200 status code if the server is healthy.

  • Response:

    • Status Code: 200