server.py 729 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from flask import Flask, render_template
  2. from lakesuperior.config_parser import config
  3. from lakesuperior.endpoints.ldp import ldp
  4. from lakesuperior.endpoints.query import query
  5. fcrepo = Flask(__name__)
  6. fcrepo.config.update(config['flask'])
  7. ## Configure enpoint blueprints here. ##
  8. fcrepo.register_blueprint(ldp, url_prefix='/ldp')
  9. # Legacy endpoint. @TODO Deprecate.
  10. fcrepo.register_blueprint(ldp, url_prefix='/rest')
  11. fcrepo.register_blueprint(query, url_prefix='/query')
  12. ## ROUTES ##
  13. @fcrepo.route('/', methods=['GET'])
  14. def index():
  15. '''
  16. Homepage.
  17. '''
  18. return render_template('index.html')
  19. @fcrepo.route('/debug', methods=['GET'])
  20. def debug():
  21. '''
  22. Debug page.
  23. '''
  24. raise RuntimeError()