Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/3n3a-archive/plz-api


https://github.com/3n3a-archive/plz-api

Last synced: about 2 months ago
JSON representation

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?
- [ ] ...