Git Product home page Git Product logo

watertruck's Introduction

watertruck

Simple Flask App with javascript/jquery HTML that shows a number of truck icons based on random number of trucks returned by the app.

Use Mac or Linux computer with Python 2.7 and virtualenv installed.

Note: When you are done with the virtual environment, just run:

deactivate

The deactivate command returns you to your "normal" environment.

Now clone the humanitarian workshop repo to get the libcloud deployment code:

git clone http://github.com/rackerlabs/humanitarian-openstack

Run the libcloud code itself to deploy to the Rackspace Cloud with credentials provided in a libcloud.conf file copied from the template:

cd humanitarian-workshop
cp participants/code/libcloud.conf.template participants/code/libcloud.conf
vi participants/code/libcloud.conf
virtualenv venv
source /venv/bin/activate
pip install -r requirements.txt
python humanitarian-workshop.py

In about ten minutes you'll have a load balancer, two web servers, and a database server deployed. You can then enter the load balancer's public IP address returned the script in your web browser and see the Flask app. It should show a random number of truck icons with each reload.

watertruck's People

Contributors

annegentle avatar vkmc avatar

Watchers

 avatar James Cloos avatar  avatar

watertruck's Issues

When clicking to api/v1.0/trucks then going back, the count increments but the icons are not re-added

To replicate:
Go to watertruck.in.
(Truck icons will match count)
Click the /api/v1.0/trucks link on index.html.
You'll see the JSON with a new value.
Click Back button in browser.
Value and truck icons match.
Click Refresh in the browser.
The index.html file redraws icons with the number given back from JSON query and does not refresh the numeric value. Also the h1 number insertion is either above the icons or below, depending on when it appends to body tag.

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.