Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/cloudacademy/voteapp-api-go

Go based API for Programming Language Voting Application
https://github.com/cloudacademy/voteapp-api-go

api cloudacademy go golang gorilla-mux mongodb

Last synced: 2 days ago
JSON representation

Go based API for Programming Language Voting Application

Awesome Lists containing this project

README

        

![Build Status](https://github.com/cloudacademy/voteapp-api-go/actions/workflows/go.yml/badge.svg)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cloudacademy/voteapp-api-go)

# Background
Provides a CRUD based API written in Go. The API is designed to read and write into a MongoDB backend database.

# API endpoints
The API provides the following endpoints:
```
GET /ok
GET /cpu
GET /version
GET /languages
GET /languages/{name}
GET /languages/{name}/vote
POST /languages/{name}
DELETE /languages/{name}
```

# API GETs with curl and jq
The API can be used to perform GETs with **curl** and **jq** like so:
```
curl -s http://localhost:8080/languages | jq .
curl -s http://localhost:8080/languages/{name} | jq .
curl -s http://localhost:8080/languages/{name}/vote | jq .
```

# API POSTs with curl
The API can be used to perform POSTs with **curl** like so:
```
curl http://localhost:8080/languages/{name} \
--header "Content-Type: application/json" \
--request POST \
--data-binary @- <