Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3n3a-archive/plz-api
https://github.com/3n3a-archive/plz-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/3n3a-archive/plz-api
- Owner: 3n3a-archive
- Archived: true
- Created: 2023-06-20T21:44:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-02T12:00:12.000Z (over 1 year ago)
- Last Synced: 2024-11-20T05:17:46.805Z (about 2 months ago)
- Language: Go
- Size: 85 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```bash
air
```## Generate Documentation (Swagger)
Run this command
```bash
swag init
```### Problems in ASDF
RUn this first
```bash
asdf reshim
```## Build Docker Image Locally
```bash
docker build -t plz-api .
```### Run the Image
Database needs to be running!
```bash
docker run --rm -p 3000:3000 --name plz_api -e DB_CONN="" plz-api
```## Todo
- [x] Consider upping the time data stays in cache, because source only updates every month... Maybe to 1 Month?
- [ ] ...