instance_relative_config=True,
)
+app.config.from_object("config.default")
+
@app.route("/")
def get_homepage():
return flask.render_template("index.html")
}
update_running_msg();
- wasm_worker = new Worker('static/src/worker.js');
+ wasm_worker = new Worker(window.ROOT_ENDPOINT + '/static/src/worker.js');
wasm_worker.onmessage = (e) => {
switch (e.data.type) {
clear_output();
let code = ace.edit('code-editor').getValue();
- let response = await fetch("/compile", {
+ let response = await fetch(window.ROOT_ENDPOINT + "/compile", {
method: 'POST',
cache: 'no-cache',
headers: {
<head>
<title>Onyx compiler</title>
- <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}" />
- <script src="{{ url_for('static', filename='src/index.js') }}"></script>
-
- <script src="{{ url_for('static', filename='src/vendor/ace/ace.js') }}"></script>
+ <link rel="stylesheet" href="{{ config['ENDPOINT'] + url_for('static', filename='css/index.css') }}" />
+ <script> window.ROOT_ENDPOINT = "{{ config['ENDPOINT']}}" </script>
+ <script src="{{ config['ENDPOINT'] + url_for('static', filename='src/index.js') }}"></script>
+ <script src="{{ config['ENDPOINT'] + url_for('static', filename='src/vendor/ace/ace.js') }}"></script>
</head>
<body>