| DayDayUp documentation | Contained in the DayDayUp distribution. |
DayDayUp - good good study, day day up
it is just a test with Mojo + KiokuDB + MooseX::Declare
but I do not mind if you use it in your localhost (at your own risk).
perl bin/day_day_up daemon
create a daydayup_local.yml at the same dir as daydayup.yml
Fayland Lam < fayland at gmail dot com >
Copyright 2008-2009 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| DayDayUp documentation | Contained in the DayDayUp distribution. |
package DayDayUp; # make CPAN happy use MooseX::Declare; class DayDayUp extends Mojolicious with DayDayUp::Extra is mutable { our $VERSION = '0.95'; use File::Spec (); use Template::Stash::XS (); use MojoX::Renderer::TT; use MojoX::Fixup::XHTML; after dispatch($c) { MojoX::Fixup::XHTML->fix_xhtml( $c ); } # This method will run once at server start method startup { # set log place my $log_path = File::Spec->catfile(File::Spec->tmpdir(), 'daydayup.log'); $self->log->path( $log_path ); print STDERR "Logging into $log_path\n"; # Routes my $r = $self->routes; # route $r->route('/notes/:id/:action', id => qr/[\w\-]+/) ->to(controller => 'notes', action => 'index'); # Default route $r->route('/:controller/:action') ->to(controller => 'notes', action => 'index'); my $tt = MojoX::Renderer::TT->build( mojo => $self, template_options => { COMPILE_DIR => File::Spec->tmpdir(), POST_CHOMP => 1, PRE_CHOMP => 1, STASH => Template::Stash::XS->new, INCLUDE_PATH => [ $self->home->rel_dir('templates') ], WRAPPER => 'wrapper.html', } ); $self->renderer->add_handler( html => $tt ); } }; 1; __END__