Exemple #1
0
    public void Configuration(IAppBuilder app)
    {
        var config = new ResttpConfiguration(typeof(HomeController).Assembly);
        config.MapHttpRoutesFromAttributes();
        config.HttpRoutes.AddRoutes
            (
            "Home",
            "/Main",
            new
            {
                controller = "Home",
                action = "Index",
                httpMethod = "Get"
            });
        config.HttpRoutes.AddRoutes
            (
            "Home",
            "/{controller}/{action}",
            new
            {
                controller = "Home"
            });

        config.DependencyResolver = GetResolver();
        app.UseResttp(config);
    }