Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/eng618/wiki-api

A Go API server for a wikipedia page
https://github.com/eng618/wiki-api

Last synced: 22 days ago
JSON representation

A Go API server for a wikipedia page

Awesome Lists containing this project

README

        

# wiki-api

[![Go](https://github.com/ENG618/wiki-api/actions/workflows/go.yml/badge.svg)](https://github.com/ENG618/wiki-api/actions/workflows/go.yml)
[![CodeQL](https://github.com/ENG618/wiki-api/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/ENG618/wiki-api/actions/workflows/codeql-analysis.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/ENG618/wiki-api)](https://goreportcard.com/report/github.com/ENG618/wiki-api)

## Overview

This is a go package that exposes an API server that exposes the information on
the Wikipedia page about Heidenheim, Germany
() in a useful and
intuitive way.

## Running the server

- clone the repo
- `go run main.go` from the root of the directory

## Routes

### /

The base route simply says hello

### /panic

The panic route is a test route on what happens when a panic is invoked, and how the program still recovers.

### /mayor

The mayor route tells you who the current mayor of Heidenheim, Germany is

### /mayor/{year}

The mayor year route allows you to pass in a year, and returns the mayor/s for that year. There is some error handling on this route. So if you pass in anything other than a valid year, the response will be a `400` with information on what went wrong.