Skip to content

Commit

Permalink
Add back #70
Browse files Browse the repository at this point in the history
This was accidentely removed in a git merge
  • Loading branch information
chriddyp committed Sep 8, 2017
1 parent b890bd8 commit 3f5acf8
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,43 +67,44 @@ def __init__(
self.registered_paths = {}

# urls
def add_url(name, view_func, methods=['GET']):
self.server.add_url_rule(
name,
view_func=view_func,
endpoint=name,
methds=methods
)

self.server.add_url_rule(
add_url(
'{}_dash-layout'.format(self.config.routes_pathname_prefix),
view_func=self.serve_layout)
self.serve_layout)

self.server.add_url_rule(
add_url(
'{}_dash-dependencies'.format(self.config.routes_pathname_prefix),
view_func=self.dependencies)
self.dependencies)

self.server.add_url_rule(
add_url(
'{}_dash-update-component'.format(
self.config.routes_pathname_prefix
),
view_func=self.dispatch,
methods=['POST'])
self.dispatch,
['POST'])

self.server.add_url_rule((
add_url((
'{}_dash-component-suites'
'/<string:package_name>'
'/<path:path_in_package_dist>').format(
self.config.routes_pathname_prefix
),
view_func=self.serve_component_suites)
self.serve_component_suites)

self.server.add_url_rule(
add_url(
'{}_dash-routes'.format(self.config.routes_pathname_prefix),
view_func=self.serve_routes
)

self.server.add_url_rule(
self.config.routes_pathname_prefix, view_func=self.index)
self.serve_routes)

# catch-all for front-end routes
self.server.add_url_rule(
'{}<path:path>'.format(self.config.routes_pathname_prefix),
view_func=self.index
)
add_url(
self.config.routes_pathname_prefix, self.index)

self.server.before_first_request(self._setup_server)

Expand Down

0 comments on commit 3f5acf8

Please sign in to comment.