servicestack default web index page

Hi Guys, So the project we started as of today I am taking care of web side of things. So may be with occasional posts on PHP I will be writing few posts on Javascript, Webservices and ServiceStack. I am not going to explain what ServiceStack is. You are here because you already know about it. In this post I am going to show you how to set Index page after you setup your ServiceStack successfully. By default when you browse you are shown metadata page. This is because you haven't set the default redirect path to your default page (Web service). I would use Page because that falls in line with web terminology. So generally you dont want users to see your metadata page if you're planning to open your software to browsers. Here is what I did The main configuration is made in the app host Configure method. I believe you have access to that CS file. in your configure method add this line [crayon-669140498875b846561570/] [crayon-6691404988760221072607/] So my Configure method looked like this [crayon-6691404988761312468963/] Advertisement   Because I am using markdown templates I will define a file which for me has nothing but "Hello world" in there. Make sure that Property "Copy to Output Directory" has value "Copy Always" Now lets check what my Index.cs file looks like   [crayon-6691404988762035617439/] Nothing much just return whatever is in there in my file that will be parsed automatically. So now when I try to browse my webservice as HTML I see Hello World on my screen rather than metdata page that highlights what web services are available. I have left some room for you to improve. My motive was to give you insight on what variable we need to set to change the default metadata page load to something else. In my next post I am going to explain how you can disable metadata altogether. I hope that helps. Cheers,   Advertisement … [Read more...]