Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

3n3a-archive/plz-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postal Code API

An API that allows searching in Switzerlands Postal Codes

Features

  • Caches Responses for 30 Minutes
  • Compresses Responses with GZIP
  • Fast JSON-Encoding

Env Vars

  • DB_CONN
  • CACHE_DURATION - in Minutes

Run Locally

air

Generate Documentation (Swagger)

Run this command

swag init

Problems in ASDF

RUn this first

asdf reshim

Build Docker Image Locally

docker build -t plz-api .

Run the Image

Database needs to be running!

docker run --rm -p 3000:3000 --name plz_api -e DB_CONN="<DB_CONN>" plz-api

Todo

  • Consider upping the time data stays in cache, because source only updates every month... Maybe to 1 Month?
  • ...