voteapp-api-go
所属分类:MongoDB
开发工具:GO
文件大小:13798KB
下载次数:0
上传日期:2023-02-23 11:45:12
上 传 者:
sh-1993
说明: 基于Go的编程语言投票应用程序API
(Go based API for Programming Language Voting Application)
文件列表:
Dockerfile (114, 2022-12-28)
go.mod (1113, 2022-12-28)
go.sum (6725, 2022-12-28)
main.go (10119, 2022-12-28)
releases (0, 2022-12-28)
releases\api-linux64 (15617093, 2022-12-28)
releases\api-osx-amd64 (15552620, 2022-12-28)
![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 @- <
近期下载者:
相关文件:
收藏者: