Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/orc/backend/orc_backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
import logging

from orc.backend.orc_backend.open_research_converter import OpenResearchConverter
from quart import Quart, jsonify, request
from quart import Blueprint, Quart, jsonify, request
from quart_cors import cors

app = Quart(__name__)
cors = cors(app)

api_bp = Blueprint("api", __name__, url_prefix="/api")

gunicorn_error_logger = logging.getLogger("gunicorn.error")
app.logger.handlers.extend(gunicorn_error_logger.handlers)
app.logger.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -80,7 +82,7 @@ def hello_world():
return description


@app.route("/healthcheck", methods=["GET"])
@api_bp.route("/healthcheck", methods=["GET"])
async def healthcheck():
"""
Check the health status of the OpenAlex API connection.
Expand Down Expand Up @@ -113,7 +115,7 @@ async def healthcheck():
return await orc.health_check()


@app.route("/start_processing", methods=["POST"])
@api_bp.route("/start_processing", methods=["POST"])
async def start_processing():
"""
Convert a list of DOIs to OpenAlex IDs.
Expand Down Expand Up @@ -187,7 +189,7 @@ async def start_processing():
return response


@app.route("/process_all", methods=["POST"])
@api_bp.route("/process_all", methods=["POST"])
async def start_processing_all():
"""
Convert DOIs to OpenAlex IDs and retrieve full bibliometric metadata.
Expand Down Expand Up @@ -244,3 +246,6 @@ async def start_processing_all():
response.headers.add("Access-Control-Allow-Origin", "*")
log.debug(f"app.py: get_data response: {response}")
return response


app.register_blueprint(api_bp)
4 changes: 1 addition & 3 deletions src/orc/frontend/orc-demo/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
PORT=3000
REACT_APP_DEV_URL=http://localhost
REACT_APP_PROD_URL=https://orc-demo.gesis.org
REACT_APP_DEV_URL=http://localhost:8001
REACT_APP_ENV=dev
108 changes: 13 additions & 95 deletions src/orc/frontend/orc-demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/orc/nginx/local.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server {
location /api/ {
proxy_set_header X-Script-Name /api;
proxy_set_header Host $host;
proxy_pass http://backend:8001/;
proxy_pass http://backend:8001;
proxy_redirect off;
proxy_read_timeout 3600s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/orc/nginx/prod.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ server {
location /api/ {
proxy_set_header X-Script-Name /api;
proxy_set_header Host $host;
proxy_pass http://backend:8001/;
proxy_pass http://backend:8001;
proxy_redirect off;
proxy_read_timeout 3600;
}
Expand Down