//-----------------------------------------------------------------------------------------------------------------------------------------------------

        private string GetStaticWebContentFolderPath(IHttpStaticFolderConfig folder)
        {
            var path = folder.LocalRootPath.DefaultIfNullOrEmpty(Directory.GetCurrentDirectory());

            if (Path.IsPathRooted(path))
            {
                return(path);
            }
            else
            {
                return(Path.Combine(Directory.GetCurrentDirectory(), path));
            }
        }
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        private static IHttpStaticFolderConfig ConfigureStaticResourceFolder(StaticResourceFolderDescription description, IHttpStaticFolderConfig config)
        {
            config.RequestBasePath = description.FolderUriPath;
            config.LocalRootPath   = description.FolderLocalPath;

            if (!string.IsNullOrEmpty(description.DefaultFileName))
            {
                config.DefaultFiles.Add(description.DefaultFileName);
            }

            return(config);
        }
Exemple #3
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        private static IHttpStaticFolderConfig ConfigureStaticResourceFolder(string urlPath, string localPath, IHttpStaticFolderConfig config)
        {
            config.RequestBasePath = urlPath;
            config.LocalRootPath   = localPath;
            config.DefaultFiles.Add("index.html");

            return(config);
        }