Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/eng618/wiki-api
- Owner: eng618
- License: mit
- Created: 2021-05-21T13:45:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-25T21:58:55.000Z (over 3 years ago)
- Last Synced: 2024-10-11T13:15:16.195Z (about 1 month ago)
- Language: Go
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
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.