#index.py
from routes.frontend import index
from routes import static
from models import setDBconnection

app = index.app

import socket    
host = socket.getfqdn()    
addr = socket.gethostbyname(host)
if(addr == '127.0.1.1'):
   app.run(host='localhost', port=7000, debug=True, reloader=True)

 

#routes/static.py
import config
from bottle import Bottle, static_file
 
app = Bottle()
 
@app.route('/static/images/<filename>')
def loadImage(filename):
    return static_file(filename, root='./public/images')
 
@app.route('/static/styles/<filename>')
def loadStyle(filename):
    return static_file(filename, root='./public/styles')
 
@app.route('/static/scripts/<filename>')
def loadScript(filename):
    return static_file(filename, root='./public/scripts')
 
@app.route('/static/scripts/ckeditor/<filename>')
def loadCKEditorScript(filename):
    return static_file(filename, root='./public/scripts/ckeditor')
 
@app.route('/static/fonts/<filename>')
def loadFont(filename):
    return static_file(filename, root='./public/fonts')
 
@app.route('/static/uploads/<filename>')
def upload(filename):
    return static_file(filename, root='./public/uploads')

 

Vercel: https://khmerweb-vlog.vercel.app

GitHub: https://github.com/Sokhavuth/vlog