morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I am currently working on a RESTful webservice that at the moment is based on an inhouse framework based on POE that only does JSON content.

As I would like to support different content-types I am thinking about moving to another framework and at the moment find Mojolicious quite interesting...

My question now is:

Is Mojo mature enough to be used for mission-critical applications or what other framework could you recommend?

Many thanks!

Replies are listed 'Best First'.
Re: RESTful web-services in Perl
by keszler (Priest) on Sep 21, 2011 at 10:25 UTC
Re: RESTful web-services in Perl
by Anonymous Monk on Sep 21, 2011 at 10:21 UTC
Re: RESTful web-services in Perl
by onelesd (Pilgrim) on Sep 21, 2011 at 17:52 UTC
    Dancer works extremely well for implementing RESTful services.

      Example REST in Dancer:

      get '/service/items' => sub { content_type 'application/json' ; my $items = $dbh->selectall_arrayref(...) ; return to_json($items) ; } ; post '/service/items/:item_id' => sub { content_type 'application/json' ; $dbh->do(...) ; return to_json({updated => 1}) ; } ; put '/service/items' => sub { content_type 'application/json' ; $dbh->do(...) ; return to_json({added => 1}) ; } ; del '/service/items/:item_id' => sub { content_type 'application/json' ; $dbh->do(...) ; return to_json({deleted => 1}) ; } ;
Re: RESTful web-services in Perl
by MidLifeXis (Monsignor) on Sep 21, 2011 at 18:17 UTC
Re: RESTful web-services in Perl
by Ottmar (Initiate) on Oct 25, 2011 at 09:20 UTC

    Hi,

    I've got the following problems by using perl for a rest/json api:

    1. What framework should I use?
    2. Is it usefull to integrate it to apache (Loadbalancing)?
    3. Loadbalancing for the REST API ... HOWTO?
    4. I want to create an API with special pathes and methods:

    I need the following structure (examples):
    /user/123 -> lists the user details of user 123
    /user/all -> the complete user List
    /user/all/10/20 -> the user List beginning at 10 to 20
    /user/all/sorted/asc
    /user/123/roles -> the roles of user 123

    Can anybody help me?

    THX Ottmar