Skip to content

Commit fb54478

Browse files
committed
adding config overload
1 parent 2659b08 commit fb54478

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ScriptCs.WebApi/WebApi.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace ScriptCs.WebApi
88
{
99
public class WebApi : IScriptPackContext
1010
{
11-
public HttpSelfHostServer CreateServer(string baseAddress)
11+
12+
public HttpSelfHostServer CreateServer(HttpSelfHostConfiguration config)
1213
{
1314
var caller = System.Reflection.Assembly.GetCallingAssembly();
14-
var config = new HttpSelfHostConfiguration(new Uri(baseAddress));
1515
config.Services.Replace(typeof(IHttpControllerTypeResolver), new ControllerResolver(caller));
1616

1717
config.Routes.MapHttpRoute(name: "DefaultApi",
@@ -20,5 +20,10 @@ public HttpSelfHostServer CreateServer(string baseAddress)
2020
);
2121
return new HttpSelfHostServer(config);
2222
}
23+
24+
public HttpSelfHostServer CreateServer(string baseAddress)
25+
{
26+
return CreateServer(new HttpSelfHostConfiguration(baseAddress));
27+
}
2328
}
2429
}

0 commit comments

Comments
 (0)