etiquette/frontends/etiquette_flask/backend/endpoints/basic_endpoints.py
Ethan Dalool 6e312bd287 Rename the etiquette_flask backend package to backend.
Alright, I got tired of confusing myself with the same-named
outer and inner package.
Keep in mind that every frontend implementation is supposed to be
its own independent project where etiquette is nothing but a
dependency. So the name backend is not ambiguous with the etiquette
backend.
2018-11-04 19:45:23 -08:00

28 lines
737 B
Python

import flask; from flask import request
import random
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