Pass parameters to Nancy Route
<p>I had a Web Service earlier which had a method as below:</p>

<pre><code>public class DxDService : System.Web.Services.WebService
{
   [WebMethod]
   [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
   public string GetSData(string strFirstName, string strLastName, string strDOB, string strSource, SortDetails sortDetails, string ID)
   {
        //manipulate the params and used to return data
   }
}
</code></pre>

<p>I consumed this <code>Webservice</code> in my <code>NodeJS</code> application with below piece of code.</p>

<pre><code>var soap=require('soap')

var url = 'http://serverName/DxDService.asmx?wsdl';
var args={'strFirstName':req.actions.firstName,'strLastName':req.actions.lastName, 'strDOB':req.actions.dob, 'strSource':'PtSearch','sortDetails':sort,'ID':''};
soap.createClient(url, function(err, client) {
      client.GetSData(args,function(err, result) {
          req.res = result;
          next();
      });
});
</code></pre>

<p>But as part of upgrade we are moving to Windows Service from Web Service which creates a host in local system on start and that host will have functionality of this <code>webservice</code>. I am using <strong><a href="https://github.com/NancyFx/Nancy" rel="nofollow"><code>Nancy</code></a></strong> here to start the <code>host</code>. But am confused on the part as how I can receive the parameters in Nancy Routes as I received in web service. Below is what I have in <code>Windows Service</code> as of now.</p>

<p><strong>Service1.cs</strong></p>

<pre><code>private NancyHost host;
protected override void OnStart(string[] args)
{
     var url = "http://127.0.0.1:port";
     this.host = new NancyHost(new Uri(url));
     this.host.Start();
}
</code></pre>

<p><strong>RootRoutes.cs</strong> which implements <strong>NancyModules</strong></p>

<pre><code>public class RootRoutes : NancyModule
{
    public RootRoutes()
    {
        //This should be same as GetSData method in webservice but this acts as Route
        Get["/GetSData"] = parameters =&gt;
        {
            //How can I access params here as I did in webservice method?
            //below is just a sample piece of code showing what returns on browsing
            http://127.0.0.1:port/GetSData

            var test = new
            {
                Name = "Guruprasad Rao",
                Twitter="@kshkrao3",
                Occupation="Software Developer"
            };
            return Response.AsJson(test);
        };
    }
}
</code></pre>

<p>How can achieve this? Any idea/help is appreciated.</p>