Пример #1
0
        public Engine(StaticContentProvider staticContentProvider, RequestDispatcher requestDispatcher)
        {
            if (staticContentProvider == null)
                throw new ArgumentNullException("staticContentProvider");
            if (requestDispatcher == null)
                throw new ArgumentNullException("requestDispatcher");

            _staticContentProvider = staticContentProvider;
            _requestDispatcher = requestDispatcher;
        }
Пример #2
0
        private StaticContentProvider BuildStaticContentProvider()
        {
            var rootPathProvider = new RootPathProvider();
            var staticContnetConventions = new StaticContentsConventions(new List<Func<Context, string, Response>>
            {
                StaticContentConventionBuilder.AddDirectory("Content")
            });
            var staticContentProvider = new StaticContentProvider(rootPathProvider, staticContnetConventions);

            FileResponse.SafePaths.Add(rootPathProvider.GetRootPath());

            return staticContentProvider;
        }