Create basic_endpoints file. Don't put them in __init__.

This commit is contained in:
voussoir 2018-02-03 01:34:07 -08:00
parent dec28b321a
commit b39f2e3f7b
2 changed files with 28 additions and 19 deletions

View file

@ -2,6 +2,7 @@ import flask; from flask import request
import random
from . import album_endpoints
from . import basic_endpoints
from . import bookmark_endpoints
from . import common
from . import photo_endpoints
@ -9,27 +10,8 @@ from . import tag_endpoints
from . import user_endpoints
site = common.site
session_manager = common.session_manager
@site.route('/')
@session_manager.give_token
def root():
motd = random.choice(common.P.config['motd_strings'])
session = session_manager.get(request)
return flask.render_template('root.html', motd=motd, session=session)
@site.route('/favicon.ico')
@site.route('/favicon.png')
def favicon():
return flask.send_file(common.FAVICON_PATH.absolute_path)
@site.route('/apitest')
@session_manager.give_token
def apitest():
response = flask.Response('testing')
return response
if __name__ == '__main__':
#site.run(threaded=True)
pass

View file

@ -0,0 +1,27 @@
import flask; from flask import request
from . import common
site = common.site
session_manager = common.session_manager
####################################################################################################
@site.route('/')
@session_manager.give_token
def root():
motd = random.choice(common.P.config['motd_strings'])
session = session_manager.get(request)
return flask.render_template('root.html', motd=motd, session=session)
@site.route('/favicon.ico')
@site.route('/favicon.png')
def favicon():
return flask.send_file(common.FAVICON_PATH.absolute_path)
@site.route('/apitest')
@session_manager.give_token
def apitest():
response = flask.Response('testing')
return response