@@ -306,13 +306,13 @@ def get_web_handlers(self, script):
306306 return [
307307 (r'/(.*)' , self .SFH , {
308308 'path' : self .root or '.' ,
309- 'default_filename' : 'index.html' ,
309+ 'default_filename' : self . default_filename ,
310310 }),
311311 ]
312312
313313 def serve (self , port = 5500 , liveport = None , host = None , root = None , debug = None ,
314314 open_url = False , restart_delay = 2 , open_url_delay = None ,
315- live_css = True ):
315+ live_css = True , default_filename = 'index.html' ):
316316 """Start serve the server with the given port.
317317
318318 :param port: serve on this port, default is 5500
@@ -325,6 +325,7 @@ def serve(self, port=5500, liveport=None, host=None, root=None, debug=None,
325325 :param open_url_delay: open webbrowser after the delay seconds
326326 :param live_css: whether to use live css or force reload on css.
327327 Defaults to True
328+ :param default_filename: launch this file from the selected root on startup
328329 """
329330 host = host or '127.0.0.1'
330331 if root is not None :
@@ -333,6 +334,8 @@ def serve(self, port=5500, liveport=None, host=None, root=None, debug=None,
333334 self ._setup_logging ()
334335 logger .info ('Serving on http://%s:%s' % (host , port ))
335336
337+ self .default_filename = default_filename
338+
336339 self .application (
337340 port , host , liveport = liveport , debug = debug , live_css = live_css )
338341
0 commit comments