leandro commited on
Commit
ecdfb50
1 Parent(s): 90ad763
Files changed (1) hide show
  1. jupyter_kernel.py +7 -2
jupyter_kernel.py CHANGED
@@ -1,9 +1,9 @@
1
- from flask import Flask, request, jsonify
2
  from jupyter_client import KernelManager
3
  import sys, io, time, queue, os
4
 
5
 
6
- app = Flask(__name__)
7
  TIMEOUT = os.getenv("TIMEOUT", 60)
8
 
9
  km = KernelManager(kernel_name='python3')
@@ -11,6 +11,11 @@ km = KernelManager(kernel_name='python3')
11
  km.start_kernel()
12
  kc = km.client()
13
 
 
 
 
 
 
14
  @app.route('/execute', methods=['POST'])
15
  def execute_code():
16
  global kc
 
1
+ from flask import Flask, request, jsonify, send_from_directory
2
  from jupyter_client import KernelManager
3
  import sys, io, time, queue, os
4
 
5
 
6
+ app = Flask(__name__, static_url_path='/static', static_folder='static')
7
  TIMEOUT = os.getenv("TIMEOUT", 60)
8
 
9
  km = KernelManager(kernel_name='python3')
 
11
  km.start_kernel()
12
  kc = km.client()
13
 
14
+
15
+ @app.route("/", methods=["HEAD", "GET"])
16
+ def index():
17
+ return send_from_directory(directory="static", path="index.html")
18
+
19
  @app.route('/execute', methods=['POST'])
20
  def execute_code():
21
  global kc