mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix urls under /sky to work again
Turns out that the /sky mapping to the gen directory was interfering with our new pattern of mapping the actual /sky directory. So now we use a more restrictive mapping pattern of only mapping /sky/services, similar for /mojo/services and /mojo/public. Fixed an exception of not finding _sky_server when a custom sky_server was already running. R=abarth@chromium.org Review URL: https://codereview.chromium.org/692163002
This commit is contained in:
parent
5e8e6e226e
commit
4899c54110
@ -65,18 +65,17 @@ def main():
|
||||
'tools.staticdir.dir': os.path.abspath(args.app_path),
|
||||
'tools.staticdir.indexlister': skydir,
|
||||
},
|
||||
'/mojo': {
|
||||
'/mojo/public': {
|
||||
'tools.staticdir.on': True,
|
||||
'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo'),
|
||||
'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'public'),
|
||||
},
|
||||
'/sky': {
|
||||
'/mojo/services': {
|
||||
'tools.staticdir.on': True,
|
||||
'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky'),
|
||||
'tools.staticdir.dir': os.path.join(GEN_ROOT, 'mojo', 'services'),
|
||||
},
|
||||
'/sky/framework': {
|
||||
'/sky/services': {
|
||||
'tools.staticdir.on': True,
|
||||
'tools.staticdir.dir':
|
||||
os.path.join(SKY_ROOT, 'framework'),
|
||||
'tools.staticdir.dir': os.path.join(GEN_ROOT, 'sky', 'services'),
|
||||
},
|
||||
}
|
||||
cherrypy.quickstart(config=config)
|
||||
|
||||
@ -26,6 +26,9 @@ SUPPORTED_MIME_TYPES = [
|
||||
]
|
||||
|
||||
class SkyDebugger(object):
|
||||
def __init__(self):
|
||||
self._sky_server = None
|
||||
|
||||
@staticmethod
|
||||
def _port_in_use(port):
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
@ -46,7 +49,8 @@ class SkyDebugger(object):
|
||||
|
||||
if self._port_in_use(HTTP_PORT):
|
||||
logging.warn(
|
||||
'Port %s already in use, assuming custom sky_server started.')
|
||||
'Port %s already in use, assuming custom sky_server started.' %
|
||||
HTTP_PORT)
|
||||
else:
|
||||
server_command = [
|
||||
os.path.join(SKY_TOOLS_DIRECTORY, 'sky_server'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user