基于python的自动加载模块
https://github.com/lepture/python-livereload
测试脚本
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/usr/bin/env python from livereload import Server, shell server = Server() server.watch('../app') server.watch('../config') server.watch('../include') server.watch('../module') server.serve(host='0.0.0.0') |
页面加入js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
class AutoReloadProvider implements ServiceProviderInterface{ /** * Registers services on the given container. * * This method should only be used to configure services and parameters. * It should not get services. * * @param Container $container A container instance */ public function register($container){ $container->extend('view', function(View $view){ $view->js->addFile("http://192.168.0.175:5500/livereload.js"); }); } } |