Reputation: 15583
I would like to create a simple http server that only returns a text but I need to use IIS with. Example, a person access a link to my server(http://anyUrl/abcdef) and my server returns a new url, like a url shorter. So it must be very fast. I dont want to create a webforms project or MVC, so how can I do that?
Upvotes: 1
Views: 451
Reputation: 597
Perhaps you could create an empty ASP.Net Application Project and add a Generic Handler (.ashx).
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("your stuff");
}
Upvotes: 2
Reputation: 14672
You need a custom HttpHandler, this kind of thing is well documented, e.g.
http://support.microsoft.com/kb/308001
Upvotes: 3
Reputation: 25763
I believe the most lightweight way of accomplishing that would be to create an ASP.NET HTTP handler. There is a short tutorial at http://support.microsoft.com/kb/308001
Upvotes: 6