Created
February 19, 2018 17:08
-
-
Save vibhatha/e68cea5526cfe4196ddf278a1b2272d7 to your computer and use it in GitHub Desktop.
Docker Flask REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hey I'm using Docker!" | |
@app.route("/api/cpu") | |
def get_cpu: | |
# ADD CODE TO GET CPU INFO | |
# USE psutil LIBRARY | |
return "SHOW YOUR CPU INFO" | |
if __name__ == "__main__": | |
app.run(host="0.0.0.0", debug=True, port=80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment