github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/test/test_apps/test_python3_app/test_python_app.py (about)

     1  from bottle import *
     2  import os
     3  
     4  @get('/ping_test')
     5  def ping_test():
     6      return {"message": "pong"}
     7  
     8  @get('/env_test')
     9  def env_test():
    10      return {"message": os.environ['KEY']}
    11  
    12  @get('/mount_test')
    13  def mount_test():
    14      with open("/data/data.txt", "rt") as in_file:
    15          text = in_file.read()
    16          return {"message": text}
    17  
    18  run(host='0.0.0.0', port=8080)