Browse Source

first panda image added

changes/37/324637/1
Jan Klare 3 years ago
parent
commit
b835ab2113
2 changed files with 5 additions and 11 deletions
  1. BIN
      images/v1/sad_panda01.png
  2. 5
    11
      main.py

BIN
images/v1/sad_panda01.png View File


+ 5
- 11
main.py View File

@@ -1,20 +1,14 @@
1
-from bottle import Bottle
1
+from bottle import Bottle, run, static_file
2 2
 
3 3
 app = Bottle()
4 4
 
5
-# Note: We don't need to call run() since our application is embedded within
6
-# the App Engine WSGI application server.
7
-
8
-
9 5
 @app.route('/')
10 6
 def hello():
11 7
     """Return a friendly HTTP greeting."""
12 8
     return 'Hello World!'
13 9
 
10
+@app.route('/v1/<filename:re:.*\.png>')
11
+def show_pic(filename):
12
+    return static_file(filename, root='images/v1/')
14 13
 
15
-# Define an handler for 404 errors.
16
-@app.error(404)
17
-def error_404(error):
18
-    """Return a custom 404 error."""
19
-    return 'Sorry, nothing at this URL.'
20
-Status API Training Shop Blog About
14
+run(app, host='localhost', port=8080, debug=True)

Loading…
Cancel
Save