Giter Club home page Giter Club logo

crypto-api's Introduction

Crypto API

Requirements

Go v1.16 (Download)

Running

Execute this command on project root folder:

go run main.go

Endpoints

This API is setted to run on port 8000 in order to avoid conflicts with the frontend server.

The currencies.json file

A "0" was added to the last decimal place of the currencies values to simplify calculations and conversions.

{
  "BRL": "5.4000",
  "EUR": "0.9200",
  "CAD": "1.4400"
}

The approach to deal with float points

The float values are converted to int before calcs do avoid rounding and inconsistencies of floats. When converting the value to integer the unit of measurement used is 1/1000 of the currency. Ex.: 4.8 = 4.8000 = 48000

The CORS problem

This API was implemented in Go using the gin frameword and is was tested during the development using the Insomnia API Client, consequently there was no CORS requests being created. But in the moment of requesting from API on frontend appeared an error invalidating requests to be made from another source.
After research it was discovered that there is currently an issue in the framework used that is causing this error: CORS Issue with Basic Auth #1799

crypto-api's People

Contributors

jullynobre avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.