chirpy

command module
v0.0.0-...-03b8691 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 16 Imported by: 0

README

chirpy

A simple Twitter clone BE in Go.

Requirements

Create - POSTgres db

Create a local - POSTgres db named chirpy

Run db migrations

Navigate to sql/schema and run goose - POSTgres "your-- POSTgres-connection-string" up

The - POSTgres connection string should look similar to below:

- POSTgresql://[- POSTgresuser]:[- POSTgresuserpassword]@localhost:5432/chirpy?sslmode=disable
Update .env
DB_URL="- POSTgres connection string"
CHIRPY_SECRET="secret key string"
POLKA_KEY="secret polka key"

Note: polka is a fake 3rd-party api, so POLKA_KEY is not necessary

Endpoints

  • GET /api/healthz
  • POST /api/chirps
  • GET /api/chirps
  • GET /api/chirps
    • optional query params author_id={id}, sort={asc or desc}
  • GET /api/chirps/{id}
  • DELETE /api/chirps/{id}
  • GET /admin/metrics
  • POST /admin/reset
  • POST /api/users
  • PUT /api/users
  • POST /api/login
  • POST /api/refresh
  • POST /api/revoke
  • POST /api/polka/webhooks

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL