Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
donnieprakoso committed Aug 18, 2018
0 parents commit 960f879
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.6-slim
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 80
CMD ["python", "app.py"]
20 changes: 20 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from flask import Flask, render_template
from flask import jsonify


app = Flask(__name__,static_url_path='/assets',static_folder='assets',template_folder='assets/templates')

@app.route("/ping/")
def ping():
data = {}
data["text"]="pong"
return jsonify(data),200

@app.route("/")
def hello():
service = {}
service["text"]="Hello, Racer!"
return render_template("index.html", service=service)

if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0', port=80)
1 change: 1 addition & 0 deletions assets/css/bulma.min.css

Large diffs are not rendered by default.

Binary file added assets/images/ryan-spencer-762284-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/js/jquery-3.2.1.min.js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions assets/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<html>

<head>
<meta charset="UTF-8">
<title>Hello, Racer!</title>
<link rel="stylesheet" href="./assets/css/bulma.min.css">

</head>
<style>
.bold{
font-weight: bold;
}


</style>
<body class="background">
<h1></h1>
<nav class="navbar" role="navigation" aria-label="main navigation" style="background-color:black;">
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img src="./assets/images/AWS_logo_RGB_REV.png" alt="" >
</a>

<button class="button navbar-burger">
<span></span>
<span></span>
<span></span>
</button>
</div>
</nav>

<div id="screen1" class="container" style="margin-top:30px;">

<div class="columns">
<div class="column is-8">
<div class="columns">
<div class="column is-12 has-text-centered" style="">
<div class="title is-1">{{service.text}}</div>
</div>
</div>

<div class="columns">
<div class="column is-12 has-text-centered" style="">
<figure class="image is-16by9">
<img src="/assets/images/ryan-spencer-762284-unsplash.jpg">
</figure>
<small>Photo by Ryan Spencer on Unsplash</small>

</div>
</div>
</div>
<div class="column is-4">
<div class="title is-4">Attribution</div>
<p>
This demo is written in <a class="bold" target="_blank" href="https://www.python.org/download/releases/3.0/">Python 3</a> with <a class="bold" target="_blank" href="http://flask.pocoo.org/">Flask Microframework</a> and rendered using <a class="bold" target="_blank" href="http://jinja.pocoo.org/">Jinja template engine</a>. Photo is credited to <a class="bold" target="_blank" href="Photo by Ryan Spencer on Unsplash">Ryan Spencer</a> on <a class="bold" target="_blank" href="https://unsplash.com/search/photos/cafe-racer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>. All styling is done with help from <a class="bold" target="_blank" href="https://bulma.io/">Bulma</a>, an open source CSS Framework. This demo is deployed using <a class="bold" target="_blank" href="https://aws.amazon.com/fargate/">AWS Fargate</a>.
</p>

<p>
This demo is created by <a class="bold" target="_blank" href="https://twitter.com/donnieprakoso/">Donnie Prakoso</a> and for full step-by-step walkthrough please refer to the blog post at <a class="bold" target="_blank" href="https://donnie.id/">https://donnie.id</a>.
</p>

</div>
</div>






</div>







</body>

</html>
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask

0 comments on commit 960f879

Please sign in to comment.