Trouble getting started

77 views
Skip to first unread message

Nabil

unread,
Jun 9, 2013, 5:27:19 PM6/9/13
to simplew...@googlegroups.com
Hi Mark,

Your framework looks really clean. I do like the single action controller pattern which none of the other frameworks use. The lack of ceremony is particularly good for simple REST backends to SPA apps. 

However it is very difficult to get started. I have read through your posts but they don't go into any detail. I've also looked at the sample app which seems out of date.

I have got as far as creating a hello world GET as below. Now how do I hook it up? Are you using any handlers? I can't see a global.asax in your examples?

Would appreciate some guidance to get me started. 

Many thanks Nabil

    [UriTemplate("/")]

    public class Index : IGet, IOutput<string>

    {

        public Status Get()

        {

            Output = "Hello World";

            return 200;

        }


        public string Output { get; private set; }

    }

Carlos Alberto Costa Beppler

unread,
Jun 9, 2013, 9:35:31 PM6/9/13
to simplew...@googlegroups.com
For ASP.NET projects the handlers are configured on web.config.

Look in this example: 


In this line all requests are configured to go through the Fix.AspNet.FixHttpHandler.

This handler is an Owin bridge between ASP.NET and Simple.Web.

Mark Rendle

unread,
Jun 10, 2013, 12:36:35 AM6/10/13
to simplew...@googlegroups.com
Hi,

Have you added the Simple.Web.AspNet package to your solution? That's needed for hosting on IIS.

Mark

Mark Rendle
Founder & CEO
Oort Corporation
Makers of Zudio


--
You received this message because you are subscribed to the Google Groups "SimpleWeb Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleweb-use...@googlegroups.com.
To post to this group, send email to simplew...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simpleweb-users/0748112a-6bee-46d8-a211-e3166c71b2d4%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nabil

unread,
Jun 10, 2013, 4:17:21 AM6/10/13
to simplew...@googlegroups.com
Mark,

I did but it didnt seem to update my web.config. Anyway I can now add it manually based on the code above.

Thanks

Nabil

unread,
Jun 10, 2013, 3:26:03 PM6/10/13
to simplew...@googlegroups.com
Ok I changed the handler to use the Fix handler.

I have a simple Get (see below). I am running in IIS express from VS2012. I get an HTTP Error 415.0. It does break into the Get method when debugging. Any ideas?

HTTP Error 415.0 - Unsupported Media Type

The server cannot service the request because the media type is unsupported.


 [UriTemplate("/")]
    public class Index : IGet
    {
        public Status Get()
        {
            return Status.OK;
        }
    }

Nabil

unread,
Jun 10, 2013, 3:28:12 PM6/10/13
to simplew...@googlegroups.com
To add to that I am not using any views. I just want to return json responses.

Carlos Alberto Costa Beppler

unread,
Jun 10, 2013, 11:15:24 PM6/10/13
to simplew...@googlegroups.com
The version 0.7.x both on NuGet or on teamcity has not the web.config.transform anymore.

I think that is the reason that the configuration is not applied to web.config.
Reply all
Reply to author
Forward
0 new messages