<html>
<h1>Hello, World</h1>
</html>
#!/usr/bin/env python3
from bottle import run, static_file, route
@route('/static/<filename>')
def server_static(filename):
return static_file(filename, root='/home/dave/test/static')
run(host='localhost', port=8080, debug=True)
Hi Dave,
a route matches against the path-part of an HTTP request URL. In your example, '/static/<filename>' would match requests to http://localhost:8080/static/index.html and serve 'index.html' file from the '/home/dave/test/static' directory. "http://localhost:8080/index.html" does not match the route you specified, thus the 404 error.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.