Skip to content

Commit

Permalink
Modified the virtual path for the example. Added an info page similar…
Browse files Browse the repository at this point in the history
… to phpinfo()
  • Loading branch information
gigi81 committed May 20, 2012
1 parent 1384e6c commit 4682875
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
3 changes: 2 additions & 1 deletion FastCgi.Test/CustomAspNetRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
6 changes: 6 additions & 0 deletions FastCgi.Test/FastCgi.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions FastCgi.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
4 changes: 3 additions & 1 deletion FastCgi.Test/Root/test.aspx
Original file line number Diff line number Diff line change
@@ -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.