|
@@ -1,39 +1,13 @@
|
|
|
-import logging
|
|
|
-import os
|
|
|
-
|
|
|
-from logging.config import dictConfig
|
|
|
-
|
|
|
-from flask import Flask, render_template
|
|
|
+from flask import render_template
|
|
|
|
|
|
+from lakesuperior.app import create_app
|
|
|
from lakesuperior.config_parser import config
|
|
|
-from lakesuperior.endpoints.ldp import ldp
|
|
|
-from lakesuperior.endpoints.query import query
|
|
|
-
|
|
|
-fcrepo = Flask(__name__)
|
|
|
-fcrepo.config.update(config['flask'])
|
|
|
-
|
|
|
-dictConfig(config['logging'])
|
|
|
-logger = logging.getLogger(__name__)
|
|
|
-logger.info('Starting LAKEsuperior HTTP server.')
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-fcrepo.register_blueprint(ldp, url_prefix='/ldp', url_defaults={
|
|
|
- 'url_prefix': 'ldp'
|
|
|
-})
|
|
|
-
|
|
|
-fcrepo.register_blueprint(ldp, url_prefix='/rest', url_defaults={
|
|
|
- 'url_prefix': 'rest'
|
|
|
-})
|
|
|
-fcrepo.register_blueprint(query, url_prefix='/query')
|
|
|
|
|
|
-
|
|
|
-tmp_path = config['application']['store']['ldp_nr']['path'] + '/tmp'
|
|
|
-if not os.path.exists(tmp_path):
|
|
|
- os.makedirs(tmp_path)
|
|
|
+fcrepo = create_app(config['flask'], config['logging'])
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@fcrepo.route('/', methods=['GET'])
|
|
|
def index():
|