crypto-vote-platform

command module
v0.0.0-...-77f29d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 3 Imported by: 0

README

Crypto Voting Platform

Live ranking system where the user can add cryptos, upvote your favorates and downvote the other ones.

Tech Used

  • Golang
  • MongoDB
  • gRPC

Endpoints

POST /crypto
Request
curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/crypto --header "Content-Type: application/json"  --data '{
    "name": "Ethereum",
}'
Response
{
  "id": "5fd6ac5c6884b412d6ec1475",
  "name": "Ethereum"
}
GET /crypto/:id
Request
curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/crypto/6057708661402e9c75b80109
Response
{
  "id": "6057708661402e9c75b80109",
  "name": "Bitcoin",
  "upvotes": 3,
  "downvotes": 1,
  "score": 2
}
POST /upvote/:id
Request
curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/upvote/6057708661402e9c75b80109 
Response
{
  "success": true
}
POST /downvote/:id
Request
curl -XPOST http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/downvote/6057708661402e9c75b80109 
Response
{
  "success": true
}
GET /cryptos
Request
curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/cryptos
Response
{
  "id": "6057708661402e9c75b80109",
  "name": "Bitcoin",
  "upvotes": 2,
  "downvotes": 1,
  "score": 1
}{
    "id": "6057708f61402e9c75b8010a",
    "name": "Ethereum",
    "upvotes": 12,
    "downvotes": 2,
    "score": 10
}{
    "id": "6057709461402e9c75b8010b",
    "name": "Litcoin",
    "upvotes": 10,
    "downvotes": 1,
    "score": 9
}
DELETE /delete/:id
Request
curl http://ec2-54-89-58-88.compute-1.amazonaws.com:8080/delete/6057708661402e9c75b80109 
Response
{
  "success": true
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL