Skip to content

Commit a154ffa

Browse files
committed
Add static file handler
1 parent b6d5158 commit a154ffa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ipython_widgets/widget_handler.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
from IPython.html.utils import url_path_join as ujoin
3+
from tornado.web import StaticFileHandler
4+
5+
module_path = os.path.dirname(__file__)
6+
def load_jupyter_server_extension(nbapp):
7+
webapp = nbapp.web_app
8+
base_url = webapp.settings['base_url']
9+
webapp.add_handlers(".*$", [
10+
(ujoin(base_url, r"/widgets/static/(.+)"), StaticFileHandler,
11+
{'path': os.path.join(module_path, 'static')}),
12+
])

0 commit comments

Comments
 (0)