Changeset 61 in bookmarks
Legend:
- Unmodified
- Added
- Removed
-
trunk/BookmarkController.pm
r59 r61 9 9 use Template; 10 10 11 has dbname => ( 12 is => 'ro', 13 required => 1, 14 ); 11 15 has bookmarks => ( 12 is => 'r w',16 is => 'ro', 13 17 handles => [qw{get_bookmark}], 18 builder => '_build_bookmarks', 19 lazy => 1, 14 20 ); 15 21 has base_uri => ( … … 20 26 has request => ( 21 27 is => 'ro', 28 required => 1, 22 29 ); 30 31 sub _build_bookmarks { 32 my $self = shift; 33 return Bookmarks->new({ 34 dbname => $self->dbname, 35 base_uri => $self->base_uri, 36 }); 37 } 23 38 24 39 sub _build_base_uri { -
trunk/api
r48 r61 3 3 4 4 Params: 5 format=json|xbel 5 format=json|xbel|text|csv|html 6 6 tag={tag} (repeatable) 7 7 limit={limit} … … 16 16 GET /feed 17 17 Gets an Atom feed of the bookmarks 18 19 Params: 20 tag={tag} (repeatable) 18 21 19 22 POST / -
trunk/app.psgi
r60 r61 8 8 9 9 use BookmarkController; 10 use Bookmarks;11 10 12 11 #TODO: allow a different config file on the command line, or set options from the command line … … 19 18 my $req = shift; 20 19 21 my $controller =BookmarkController->new({20 return BookmarkController->new({ 22 21 request => $req, 22 dbname => $config->{dbname}, 23 23 }); 24 my $bookmarks = Bookmarks->new({25 dbname => $config->{dbname},26 base_uri => $controller->base_uri,27 });28 $controller->bookmarks($bookmarks);29 return $controller;30 24 } 31 25
Note: See TracChangeset
for help on using the changeset viewer.