In [ ]:
# from flask import Flask
# app = Flask(__name__) #__name__ == "__main__"
# @app.route("/")
# def home():
# return "hello world"
# if __name__ == "__main__":
# app.run()
In [ ]:
# from flask import Flask
# app = Flask(__name__) #__name__ == "__main__"
# @app.route("/")
# def home():
# return "hello world"
# if __name__ == "__main__":
# app.run(host="0.0.0.0", port="8080")
In [ ]:
from flask import Flask
app = Flask(__name__) #__name__ == "__main__"
@app.route("/")
def home():
return "hello world"
@app.route("/rooms/<room_id>")
def room(room_id):
return room_id
if __name__ == "__main__":
app.run(host="0.0.0.0", port="8080")
In [ ]:
from flask import Flask
import requests
app = Flask(__name__) #__name__ == "__main__"
@app.route("/")
def home():
return "hello world"
@app.route("/rooms/<room_id>")
def room(room_id):
response = requests.get("https://api.zigbang.com/v1/items?detail=true&item_ids=" + str(room_id))
return response.text
if __name__ == "__main__":
app.run(host="0.0.0.0", port="8080")
In [ ]:
from flask import Flask, render_template
import requests
app = Flask(__name__) #__name__ == "__main__"
@app.route("/")
def home():
return "<h1>hello world</h1><p>This is home</p>"
@app.route("/rooms/<room_id>")
def room(room_id):
response = requests.get("https://api.zigbang.com/v1/items?detail=true&item_ids=" + str(room_id))
return response.text
if __name__ == "__main__":
app.run(host="0.0.0.0", port="8080")
In [ ]: