-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_api_server.py
More file actions
31 lines (24 loc) · 1001 Bytes
/
run_api_server.py
File metadata and controls
31 lines (24 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) AIME GmbH and affiliates. Find more info at https://www.aime.info/api
#
# This software may be used and distributed according to the terms of the AIME COMMUNITY LICENSE AGREEMENT
from sanic_sessions import Session, InMemorySessionInterface
from api_server.api_server import APIServer
from api_server.utils.misc import copy_js_client_interface_to_frontend_folder
from api_server.admin_interface import MinimumAdminBackendImplementation
from sanic_ext import Extend
API_NAME = "AIME_API_Server"
app = APIServer(API_NAME)
app.config.CORS_ORIGINS = "*"
Extend(app)
# Initialize session middleware
session = Session(app, interface=InMemorySessionInterface())
admin_backend = MinimumAdminBackendImplementation(app, app.args, None)
app.connect_admin_backend(admin_backend)
if __name__ == "__main__":
copy_js_client_interface_to_frontend_folder()
app.run(
host=app.host,
port=app.port,
debug=app.args.dev,
workers=app.args.worker_processes
)