Skip to content

SSGolangProjects/crypto-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto-server

A simple Crypto server that supports below URI's

curl http://localhost:8080/currency/btcusd
curl http://localhost:8080/currency/ethbtc
curl http://localhost:8080/currency/all

Build and run

Run below commands

go get https://github.com/basicsbeauty/crypto-server
cd crypto-server
go run main.go

Checklist of items

  • Server configuration is driven by a JSON file, config.json
  • Support for parameters {port number, source API URL, supported tickers}
  • Websocket implementation to keep the data in sync
  • Used local cache to store and serve requests
  • Used native HTTP library for handling REST API calls
  • Handled corner cases, the server only responds to GET calls for /currency/
  • Developed separate modules for {config, pricing data, websocket communication} for modularity
  • Unit tests

Libraries

Used gorilla/websocket library for handling web socket network IO for better reliability and its battle-tested.

About

Crypto-server, a simple web server for getting {BTC, ETH} real-time pricing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages