Skip to content

Greeshmanth1909/chirpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chirpy

A webserver that manages chirps(tweets), built with Golang and a custom "database" that stores information in a .json file.

Requirements

go 1.22.2 or greater

Installation and Setup

  • clone the project with git clone https://github.com/Greeshmanth1909/chirpy.git
  • Install project dependencies by running go mod tidy in the root of the project

Running the server

Run the server with go run . in the root or compile and execute the binary with go build && ./chirpy

Endpoints

  1. /app/api/healthz checks the readyness of the server by returning 200 OK if the server is up and running (temporary referance only)
serveMux.Handle("/app/", http.StripPrefix("/app/", hits.middlewareMetricsInc(http.FileServer(http.Dir(".")))))
    serveMux.HandleFunc("GET /api/healthz", readyness)
    serveMux.HandleFunc("GET /admin/metrics", metricsHandler)
    serveMux.HandleFunc("/api/reset", resetHandler)
    serveMux.HandleFunc("POST /api/chirps", valChirpHandler)
    serveMux.HandleFunc("GET /api/chirps", getChirps)
    serveMux.HandleFunc("GET /api/chirps/{chirpid}", getChirpById)
    serveMux.HandleFunc("POST /api/users", postUsers)
    serveMux.HandleFunc("PUT /api/users", updateUsers)
    serveMux.HandleFunc("POST /api/login", loginUsers)
    serveMux.HandleFunc("POST /api/refresh", refresh)
    serveMux.HandleFunc("POST /api/revoke", revoke)

Technicals

  • jwt
  • CRUD operations

About

A webserver built with Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published