Coder Social home page Coder Social logo

wallet_flexing's Introduction

Flexing on nerds

This is an api that has no purpose except to flex on people.

Building

Run make build to build. Requires go 1.11 or later to use mod to install dependencies.

Running

Run using ./bin/api

The default port the http server runs on is 6969. To change the port, set a PORT environment variable (e.g. PORT=7000 ./bin/api)

Tests

Run tests using make build

API

curl to do a GET for some time period:

curl '0.0.0.0:6969/transactions?start_date_time=2020-03-01T22%3A43%3A26%2B00%3A00&end_date_time=2020-03-01T22%3A44%3A26%2B00%3A00'

curl to do a GET for all transactions:

curl 0.0.0.0:6969/transactions

curl to POST a transaction:

curl -v -XPOST '0.0.0.0:6969/transactions' -d '{"datetime": "2019-10-05T13:00:00+00:00", "amount": 1000}'

Why are amounts sometimes higher in the past?

Since transactions are listed a descending order by timestamp and not by amounts, if an amount is reported late, the total will be adjusted for when it actually gets reported.

If it's a requested feature, perhaps it'd make sense to add things like a posted date or sorting by amount.

Why is the GET time period range for query parameters and not in the body?

GET is semantically supposed to ignore the body. Perhaps this could have been implemented as a POST, but that wouldn't have been RESTful.

wallet_flexing's People

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.