GithubHelp home page GithubHelp logo

ammarion / stellitime-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stelligent/stellitime-api

0.0 1.0 0.0 563 KB

Example mini-app to use during interview process.

Python 87.30% Makefile 12.70%

stellitime-api's Introduction

stellitime-api

Small sample program to facilitate discussions

Description

./app.py invokes a get() or post() operation, depending on absense or presence of a payload argument consisting of a JSON payload containing a "message" string property.

The counter value is stored in a DynamoDB table that has a single row with id and counter_value attributes. The key field id can be overridden by export COUNTER_KEY=some-key.

  • the get() function returns a JSON payload:

    • current time
    • current counter_value from the DynamoDB table
    • and the message Automation For The People
  • the put() function takes a JSON payload containing a message property as input, and also returns a JSON payload:

    • current time
    • incremented counter_value from the DynamoDB table
    • and a copy of message that was passed on the command line.

Setup:

Type make all to:

  • install python3 prerequisites stored in requirements.txt
  • deploy a tiny Cloudformation stack creating the DynamoDB table.

Example Usage:

  • The retrieve the current time and the current counter value (the get() function):
    ./app.py
    
  • To echo an arbitary message, and increment the counter (the put() function):
    ./app.py '{ "message" : "some-string" }' 
    

Example Output

(colorization courtesy of `jq`)

stellitime-api's People

Contributors

thegonch avatar timbaileyjones avatar rjulian avatar

Watchers

James Cloos 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.