Permalink
Browse files

Modified the virtual path for the example. Added an info page similar…

… to phpinfo()
  • Loading branch information...
1 parent 1384e6c commit 46828758ad73360559d29f18b123fb1dd626e5cd @gigi81 committed May 20, 2012
Showing with 23 additions and 14 deletions.
  1. +2 −1 FastCgi.Test/CustomAspNetRequest.cs
  2. +6 −0 FastCgi.Test/FastCgi.Test.csproj
  3. +12 −12 FastCgi.Test/Program.cs
  4. +3 −1 FastCgi.Test/Root/test.aspx
@@ -12,7 +12,8 @@ public class CustomAspNetRequest : AspNetRequest
public CustomAspNetRequest(ushort id, BeginRequestMessageBody body)
: base(id, body)
{
- this.VirtualPath = "/simple";
+ //must be the same values used when calling ApplicationHost.CreateApplicationHost
+ this.VirtualPath = "/";
this.PhysicalPath = Path.Combine(Directory.GetCurrentDirectory(), "Root");
}
}
@@ -105,6 +105,12 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Root\info.aspx">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <SubType>ASPXCodeBehind</SubType>
+ </None>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(TargetDir)Root\bin"
View
@@ -9,18 +9,18 @@
namespace FastCgi.Test
{
- class Program
- {
- static void Main(string[] args)
- {
+ class Program
+ {
+ static void Main(string[] args)
+ {
string path = Path.Combine(Directory.GetCurrentDirectory(), "Root");
- SimpleServer server = (SimpleServer)ApplicationHost.CreateApplicationHost(typeof(SimpleServer), "/simple", path);
- server.Start();
+ SimpleServer server = (SimpleServer)ApplicationHost.CreateApplicationHost(typeof(SimpleServer), "/", path);
+ server.Start();
- while (true)
- {
- System.Threading.Thread.Sleep(1000);
- }
- }
- }
+ while (true)
+ {
+ System.Threading.Thread.Sleep(1000);
+ }
+ }
+ }
}
@@ -1,2 +1,4 @@
Hello world!<br />
-Datetime here is: <% = DateTime.Now.ToString() %>
+Datetime here is: <% = DateTime.Now.ToString() %><br />
+Path is: <% =Request.Path %><br />
+PathInfo is: <% =Request.PathInfo %><br />

0 comments on commit 4682875

Please sign in to comment.