简体   繁体   中英

How to run Python Eve application on a different port

I'm trying to run this application on a different port(8080). I tried putting the port parameter but it doesn't seem to work.

I'm getting a 404 page, but when i switch port to 5000, I encounter no problem.

from eve import Eve
app = Eve()

@app.route("/hello", methods=['GET'])
def hello():
    return "Hello World!"

if __name__ == '__main__':
    app.run(port=8080, debug=True)

确保在设置文件中设置了SERVER_NAME = None (默认设置)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM