Skip to content

Commit e79eb6c

Browse files
committed
Added documentation to the hello world project on the supported options/modes for hosting ServiceStack
1 parent 22bd29e commit e79eb6c

1 file changed

Lines changed: 52 additions & 21 deletions

File tree

src/ServiceStack.Hello/default.htm

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
float: right;
8484
}
8585

86+
H3 B
87+
{
88+
color: #061;
89+
}
8690
H4 B
8791
{
8892
color: #555;
@@ -122,6 +126,19 @@
122126
padding: 0 20px 20px 0;
123127
}
124128

129+
#configpath
130+
{
131+
margin: 0 0 40px 0;
132+
}
133+
#configpath DT
134+
{
135+
line-height: 30px;
136+
font-weight: bold;
137+
}
138+
#configpath DD
139+
{
140+
margin: 0 0 0 10px;
141+
}
125142

126143
</style>
127144
</head>
@@ -161,13 +178,44 @@ <h2>2. Configuring Service Stack to run in your application</h2>
161178
Add a reference to the <a href="https://github.com/ServiceStack/ServiceStack/downloads">latest ServiceStack.dll's</a> to your project:
162179
</p>
163180

181+
164182
<p>
165-
Register the ServiceStack handler with in your ASP.NET application
166-
by adding either of the following to your <strong>Web.config</strong>:
183+
There are 2 supported options available to register ServiceStack in your ASP.NET application <strong>Web.config</strong>:
167184
</p>
185+
<dl id="configpath">
186+
<dt>a) host at: <a href="#rootpath">/</a></dt>
187+
<dd>When running ServiceStack as standalone (i.e. don't need to use an existing framework)</dd>
188+
189+
<dt>b) host at: <a href="#custompath">/custompath</a></dt>
190+
<dd>When you're using ServiceStack together with an existing web framework</dd>
191+
</dl>
192+
193+
<h3><a name="rootpath"></a>a) You do not require an existing Web Framework - Host from the root path: <b>/</b></h3>
194+
<p>
195+
You can host at the root path <b>/</b> when you don't need to use an existing Web Framework with your ServiceStack web services (i.e. project only has static files)
196+
</p>
197+
<h4>The configuration below allows you to host your webservices from the root path: <b>/</b></h4>
198+
<code class="web-config">&lt;system.web&gt;
199+
&lt;httpHandlers&gt;
200+
&lt;add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/&gt;
201+
&lt;/httpHandlers&gt;
202+
&lt;/system.web&gt;
168203

169-
<h3>Host Web services at a custom path: <b>/servicestack</b></h3>
170-
<h4>Use the location configuration below to host webservices at the custom path: <b>/servicestack</b></h4>
204+
&lt;!-- Required for IIS 7.0 --&gt;
205+
&lt;system.webServer&gt;
206+
&lt;handlers&gt;
207+
&lt;add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /&gt;
208+
&lt;/handlers&gt;
209+
&lt;/system.webServer&gt;
210+
</code>
211+
212+
<h3><a name="custompath"></a> b) You require an existing Web Framework - Host web services at: <b>/custompath</b></h3>
213+
<p>
214+
In order to avoid conflicts with your existing ASP.NET web framework it is recommended to host your ServiceStack web services at a custom path.<br />
215+
This will allow you to use ServiceStack together with an existing web framework
216+
e.g. <a href="http://www.asp.net/mvc">ASP.NET MVC 3</a> or <a href="http://code.google.com/p/fubumvc/">FUBU MVC</a>, etc.
217+
</p>
218+
<h4>The location configuration below hosts your webservices at custom path: <b>/servicestack</b></h4>
171219
<code class="web-config">&lt;location path="servicestack"&gt;
172220
&lt;system.web&gt;
173221
&lt;httpHandlers&gt;
@@ -184,23 +232,6 @@ <h4>Use the location configuration below to host webservices at the custom path:
184232
&lt;/handlers&gt;
185233
&lt;/system.webServer&gt;
186234
&lt;/location&gt;
187-
</code>
188-
189-
<h3>Host Web services at the root path: /</h3>
190-
<h4>Wildcard Handler mapping for IIS 6.0, MONO or VS.NET dev web server</h4>
191-
<code class="web-config">&lt;system.web&gt;
192-
&lt;httpHandlers&gt;
193-
&lt;add path="servicestack*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/&gt;
194-
&lt;/httpHandlers&gt;
195-
&lt;/system.web&gt;
196-
</code>
197-
198-
<h4>Wildcard Handler mapping for IIS 7+</h4>
199-
<code class="web-config">&lt;system.webServer&gt;
200-
&lt;handlers&gt;
201-
&lt;add path="servicestack" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /&gt;
202-
&lt;/handlers&gt;
203-
&lt;/system.webServer&gt;
204235
</code>
205236

206237
<h2>3. Creating your first Web Service</h2>

0 commit comments

Comments
 (0)