Ejemplo n.º 1
0
        public FubuRuntime LaunchRunner()
        {
            var refresher = _container.GetInstance<IBrowserRefresher>();

            refresher.StartWebSockets();
            _settings.WebsocketAddress = "ws://localhost:" + refresher.Port;


            _topicWatcher = new TopicFileWatcher(_settings, this);
            _topicWatcher.StartWatching(refresher);

            var registry = new TopicRegistry() {RootPath = _settings.Root};
            registry.AlterSettings<OwinSettings>(_ =>
            {
                _.Middleware.InsertFirst(new MiddlewareNode<TopicMiddleware>());
            });

            registry.StructureMap(_container);

            return registry.ToRuntime();
        }
Ejemplo n.º 2
0
        public EmbeddedFubuMvcServer LaunchRunner()
        {
            var refresher = _container.GetInstance<IBrowserRefresher>();

            refresher.StartWebSockets();
            _settings.WebsocketAddress = "ws://localhost:" + refresher.Port;

            _topicWatcher = new TopicFileWatcher(_settings);
            _topicWatcher.StartWatching(refresher);

            var sampleBuilder = scanForSamples();

            sampleBuilder.EnableWatching();

            var registry = new TopicRegistry(_topic);
            return FubuApplication.For(registry).StructureMap(_container).RunEmbeddedWithAutoPort(_settings.Root);
        }