forked from renefritze/spring-infolog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
executable file
·28 lines (22 loc) · 874 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import route, run, debug, PasteServer, send_file, redirect, abort, request, default_app
import os, index, upload, recordlist, details
from siteglobals import config
@route('/images/:filename')
def image_file(filename):
return send_file( filename, root=os.getcwd()+'/images/' )
@route('/static/:filename')
def static_file(filename):
return send_file( filename, root=os.getcwd()+'/static/' )
uploads = '/%s/' % config.get('site','uploads')
@route(uploads + ':filename')
def log_file(filename):
return send_file( filename, root=os.getcwd()+ uploads )
@route('/favicon.ico')
def favi():
return send_file( 'favicon.ico', root=os.getcwd()+'/images/' )
if __name__=="__main__":
port = config.getint('site','port')
app = default_app()
run(app=app,server=PasteServer,host='localhost',port=port , reloader=False)