Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit 86b1ac8

Browse files
committed
Initial static files port.
0 parents  commit 86b1ac8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2940
-0
lines changed

.gitattributes

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
*.doc diff=astextplain
2+
*.DOC diff=astextplain
3+
*.docx diff=astextplain
4+
*.DOCX diff=astextplain
5+
*.dot diff=astextplain
6+
*.DOT diff=astextplain
7+
*.pdf diff=astextplain
8+
*.PDF diff=astextplain
9+
*.rtf diff=astextplain
10+
*.RTF diff=astextplain
11+
12+
*.jpg binary
13+
*.png binary
14+
*.gif binary
15+
16+
*.cs text=auto diff=csharp
17+
*.vb text=auto
18+
*.resx text=auto
19+
*.c text=auto
20+
*.cpp text=auto
21+
*.cxx text=auto
22+
*.h text=auto
23+
*.hxx text=auto
24+
*.py text=auto
25+
*.rb text=auto
26+
*.java text=auto
27+
*.html text=auto
28+
*.htm text=auto
29+
*.css text=auto
30+
*.scss text=auto
31+
*.sass text=auto
32+
*.less text=auto
33+
*.js text=auto
34+
*.lisp text=auto
35+
*.clj text=auto
36+
*.sql text=auto
37+
*.php text=auto
38+
*.lua text=auto
39+
*.m text=auto
40+
*.asm text=auto
41+
*.erl text=auto
42+
*.fs text=auto
43+
*.fsx text=auto
44+
*.hs text=auto
45+
46+
*.csproj text=auto
47+
*.vbproj text=auto
48+
*.fsproj text=auto
49+
*.dbproj text=auto
50+
*.sln text=auto eol=crlf

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[Oo]bj/
2+
[Bb]in/
3+
TestResults/
4+
.nuget/
5+
_ReSharper.*/
6+
packages/
7+
artifacts/
8+
PublishProfiles/
9+
*.user
10+
*.suo
11+
*.cache
12+
*.docstates
13+
_ReSharper.*
14+
nuget.exe
15+
*net45.csproj
16+
*k10.csproj
17+
*.psess
18+
*.vsp
19+
*.pidb
20+
*.userprefs
21+
*DS_Store
22+
*.ncrunchsolution

Microsoft.AspNet.StaticFiles.sln

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.30110.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.net45", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.net45.csproj", "{49278B83-CC12-49EA-8F61-D143863DD21B}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.k10", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.k10.csproj", "{297551FE-7539-4E43-A6B8-165C7789F48D}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.k10", "samples\StaticFileSample\StaticFileSample.k10.csproj", "{8C5384FC-24F3-47F2-897C-A151604F011C}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.net45", "samples\StaticFileSample\StaticFileSample.net45.csproj", "{742E16CD-8217-4386-AAF0-5F116E62CD82}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.Build.0 = Release|Any CPU
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
GlobalSection(NestedProjects) = preSolution
45+
{297551FE-7539-4E43-A6B8-165C7789F48D} = {40EE0889-960E-41B4-A3D3-9CE963EB0797}
46+
{49278B83-CC12-49EA-8F61-D143863DD21B} = {40EE0889-960E-41B4-A3D3-9CE963EB0797}
47+
{8C5384FC-24F3-47F2-897C-A151604F011C} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60}
48+
{742E16CD-8217-4386-AAF0-5F116E62CD82} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60}
49+
EndGlobalSection
50+
EndGlobal

NuGet.Config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/" />
5+
<add key="NuGet.org" value="https://nuget.org/api/v2/" />
6+
</packageSources>
7+
<packageSourceCredentials>
8+
<AspNetVNext>
9+
<add key="Username" value="aspnetreadonly" />
10+
<add key="ClearTextPassword" value="4d8a2d9c-7b80-4162-9978-47e918c9658c" />
11+
</AspNetVNext>
12+
</packageSourceCredentials>
13+
</configuration>

build.cmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@echo off
2+
cd %~dp0
3+
4+
SETLOCAL
5+
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
6+
7+
IF EXIST %CACHED_NUGET% goto copynuget
8+
echo Downloading latest version of NuGet.exe...
9+
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
10+
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
11+
12+
:copynuget
13+
IF EXIST .nuget\nuget.exe goto restore
14+
md .nuget
15+
copy %CACHED_NUGET% .nuget\nuget.exe > nul
16+
17+
:restore
18+
IF EXIST packages\KoreBuild goto run
19+
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
20+
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion
21+
22+
:run
23+
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"sources": ["src"]
3+
}

makefile.shade

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
var VERSION='0.1'
3+
var FULL_VERSION='0.1'
4+
var AUTHORS='Microsoft'
5+
6+
use-standard-lifecycle
7+
k-standard-goals

samples/StaticFileSample/Program.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
#if NET45
3+
using System.Diagnostics;
4+
using Microsoft.Owin.Hosting;
5+
#endif
6+
7+
namespace StaticFilesSample
8+
{
9+
public class Program
10+
{
11+
const string baseUrl = "http://localhost:9001/";
12+
13+
public static void Main()
14+
{
15+
#if NET45
16+
using (WebApp.Start<Startup>(new StartOptions(baseUrl)))
17+
{
18+
Console.WriteLine("Listening at {0}", baseUrl);
19+
Process.Start(baseUrl);
20+
Console.WriteLine("Press any key to exit");
21+
Console.ReadKey();
22+
}
23+
#else
24+
Console.WriteLine("Hello World");
25+
#endif
26+
}
27+
}
28+
}

samples/StaticFileSample/Startup.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#if NET45
2+
using System;
3+
using System.IO;
4+
using Microsoft.AspNet.Abstractions;
5+
using Microsoft.Owin.FileSystems;
6+
using Microsoft.AspNet;
7+
using Owin;
8+
using Microsoft.AspNet.StaticFiles;
9+
10+
namespace StaticFilesSample
11+
{
12+
public class Startup
13+
{
14+
public void Configuration(IAppBuilder app)
15+
{
16+
app.UseErrorPage();
17+
18+
// Temporary bridge from katana to Owin
19+
app.UseBuilder(ConfigurePK);
20+
}
21+
22+
private void ConfigurePK(IBuilder builder)
23+
{
24+
builder.UseFileServer(new FileServerOptions()
25+
{
26+
EnableDirectoryBrowsing = true,
27+
FileSystem = new PhysicalFileSystem(@"c:\temp")
28+
});
29+
}
30+
}
31+
}
32+
#endif

samples/StaticFileSample/project.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version" : "0.1-alpha-*",
3+
"dependencies": {
4+
"Microsoft.AspNet.FileSystems": "0.1-alpha-*",
5+
"Microsoft.AspNet.StaticFiles": "",
6+
"Microsoft.AspNet.Abstractions": "0.1-alpha-*"
7+
},
8+
"configurations": {
9+
"net45": {
10+
"dependencies": {
11+
"Owin": "1.0",
12+
"Microsoft.Owin": "2.1.0",
13+
"Microsoft.Owin.Diagnostics": "2.1.0",
14+
"Microsoft.Owin.Hosting": "2.1.0",
15+
"Microsoft.Owin.Host.HttpListener": "2.1.0",
16+
"Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*"
17+
}
18+
},
19+
"k10" : { }
20+
}
21+
}

0 commit comments

Comments
 (0)