2020-07-14 02:39:43 +12:00
|
|
|
from os.path import abspath
|
|
|
|
from os import getcwd
|
|
|
|
from pathlib import Path
|
2020-07-08 07:46:45 +12:00
|
|
|
|
2020-07-14 02:39:43 +12:00
|
|
|
from bottle import route, run, static_file
|
|
|
|
|
|
|
|
@route("/")
|
2020-07-08 07:46:45 +12:00
|
|
|
def index():
|
|
|
|
return "Hello"
|
|
|
|
|
2020-07-14 02:39:43 +12:00
|
|
|
@route("/static/<filename>")
|
|
|
|
def static_path(filename):
|
|
|
|
template_path = abspath(getcwd()) / Path("tests/mock_server/templates")
|
2020-07-23 03:24:08 +12:00
|
|
|
response = static_file(filename, root=template_path)
|
|
|
|
response.set_header("Content-Type", "")
|
|
|
|
return response
|
2020-07-14 02:39:43 +12:00
|
|
|
|
2020-07-08 07:46:45 +12:00
|
|
|
def start():
|
|
|
|
run(host='localhost', port=8080)
|