Flask doesn't work


import random
from flask import Flask
from flask_restful import Api, Resource

app = Flask(__name__)
api = Api(app)

class HelloWorld(Resource):
    def get(self):
        return {'hello': 'world'}

api.add_resource(HelloWorld, '/')

if __name__ == '__main__':
    port = 5000 + random.randint(0, 999)
    url = "{0}".format(port)
    print(url), host='')

Hello. Why doesn't it work?

If you do get('').json() nothing happens.

You should deploy the web app using the UI on the Web page, you will not be able to run it on a localhost. See this help page.