bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.44k stars 1.47k forks source link

404 error on running this code #1124

Closed 0xh0n3y closed 5 years ago

0xh0n3y commented 5 years ago

from bottle import route, run @route(/hello) def hello(): return "Hello World!" run(host=localhost, port=8080, debug=True)

defnull commented 5 years ago

That is not the code you are running (syntax errors and uninitialized variables)

1estart commented 5 years ago

You need quotes for '/hello' and 'localhost'. And then 'Hello World!' will be localhost/8080/hello

Stormx480 commented 5 years ago

`from bottle import route, run

@route('/hello/') def index(): return 'Hello World'

run(host='localhost', port=8080, debug=True)`