File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 10
10
from notebook .utils import url_path_join , url_escape
11
11
from notebook .base .handlers import APIHandler
12
12
13
- path_regex = r'(?P<path>(?:(?:/[^/]+)+|/?))'
14
13
link_regex = re .compile (r'<([^>]*)>;\s*rel="([\w]*)\"' )
15
14
GITHUB_API = 'https://api.github.com'
16
15
@@ -100,5 +99,7 @@ def load_jupyter_server_extension(nb_server_app):
100
99
nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance.
101
100
"""
102
101
web_app = nb_server_app .web_app
103
- host_pattern = '.*$'
104
- web_app .add_handlers (host_pattern , [(r'/github%s' % path_regex , GitHubHandler )])
102
+ base_url = web_app .settings ['base_url' ]
103
+ endpoint = url_path_join (base_url , 'github' )
104
+ handlers = [(endpoint + "(.*)" , GitHubHandler )]
105
+ web_app .add_handlers ('.*$' , handlers )
You can’t perform that action at this time.
0 commit comments