my $loglv = $cnf->{level};
if (grep { $loglv eq $_ } qw(debug info warn error fatal)) {
$app->log->level($loglv);
+ $app->log->info("set log level to $loglv");
}
else {
$app->log->warn('invalid log level given in config file');
$app->plugin('Newslash::Plugin::Model', { bypass_startup => $maintenance_mode });
# use Easy Cache ($app->ezcache)
- $app->plugin('Newslash::Plugin::EasyCache');
+ #$app->plugin('Newslash::Plugin::EasyCache');
+
+ # use CompositeCache Cache ($app->ccache)
+ $app->plugin('Newslash::Plugin::CompositeCache');
# use Template::Toolkit 2 render
$app->plugin('Newslash::Plugin::TT2Renderer');
# ReCaptcha control
$app->plugin('Newslash::Plugin::ReCaptcha');
+ # Post Filter
+ $app->plugin('Newslash::Plugin::PostFilter');
+
# set canocal (for test.srad.jp)
$app->plugin('Newslash::Plugin::Canonical');
# Event Que
$app->plugin('Newslash::Plugin::EventQue');
- # Statics Logger
- $app->plugin('Newslash::Plugin::Statics');
+ # Stats Logger
+ $app->plugin('Newslash::Plugin::Stats');
# Request Body based routing condition
$app->plugin('Newslash::Plugin::RequestBodyCondition');
# Sendmail helper
$app->plugin('Newslash::Plugin::Sendmail');
+ # Wiki contents reader helper
+ $app->plugin('Newslash::Plugin::WikiContentsReader');
+
############################################################
#
# Routing Settings
$r->get('/polls')->to('timeline#polls');
# RSS
- $r->get('/:rss_type' => [format => ['rss', 'xml']])->to('rss#timeline');
+ $r->get('/:rss_type' => [format => ['rss', 'xml']])->to('rss#stories');
+ $r->get('/journals/rss')->to('rss#journals');
# Banned page
$r->get('/banned')->to('index#banned', noindex => 1);
$r->get('/comment/:cid/')->to('comment#single');
# journal page
+ # also see user page settings for /~username/journal/
$r->get('/journal/new')->to('journal#create', seclev => 1);
$r->get('/journal/:id/')->to('journal#single');
$r->get('/submission/:year/:month/')->to('archive#submission');
$r->get('/submission/')->to('archive#submission');
+ $r->get('/comment/:year/:month/:day/')->to('archive#comment');
+ $r->get('/comment/:year/:month/')->to('archive#comment');
+ $r->get('/comment/')->to('archive#comment');
+
$r->get('/poll/:year/:month/')->to('archive#poll');
$r->get('/poll/')->to('archive#poll');
# search page
$r->get('/search')->to('search#search');
+ # about
+ $r->get('/about')->to('about#about');
+
+ #faq
+ $r->get('/faq/editorial')->to('faq#editorial');
+ $r->get('/faq/UI')->to('faq#UI');
+ $r->get('/faq/firehose')->to('faq#firehose');
+ $r->get('/faq/com-mod')->to('faq#com_mod');
+ $r->get('/faq/metamod')->to('faq#metamod');
+ $r->get('/faq/accounts')->to('faq#accounts');
+ $r->get('/faq/friends')->to('faq#friends');
+ $r->get('/faq/tech')->to('faq#tech');
+ $r->get('/faq/')->to('faq#faq');
+
# Admin
# pages under /admin needs seclev equal or greater than 10000;
my $admin = $r->under('/admin' => sub { my $c = shift; $c->stash(seclev => 10000); return 1; });
$admin->get('/sidebar')->to('admin-sidebar#index');
$admin->get('/feed')->to('admin-feed#index');
+ $admin->get('/filter')->to('admin-filter#index');
$admin->get('/blocking')->to('admin-blocking#index');
$admin->get('/ad')->to('admin-ads#index');
# Admin API
# pages under /api/v1/admin needs seclev equal or greater than 10000;
my $admin_api = $r->under('/api/v1/admin' => sub { my $c = shift; $c->stash(seclev => 10000); return 1; });
+
$admin_api->get('/feed')->to('API::Admin::Feed#get');
$admin_api->post('/feed')->to('API::Admin::Feed#post');
+ $admin_api->get('/filter')->to('API::Admin::Filter#get');
+ $admin_api->post('/filter')->to('API::Admin::Filter#post');
$admin_api->get('/blocking')->to('API::Admin::Blocking#get');
$admin_api->post('/blocking')->to('API::Admin::Blocking#post');
$api->get('/story')->to('API::Story#get');
$api->post('/story')->to('API::Story#post');
+ $api->get('/timeline')->to('API::Timeline#get');
+
$api->get('/poll')->to('API::Poll#get');
$api->post('/poll')->to('API::Poll#post');
$api->post('/vote')->to('API::Poll#vote', csrf_check_id => 'vote');
# warning: these pathes uses regexp matching, so must write in tail of route definitions.
my $user = $r->under('/~:nickname');
$user->get('/' => [nickname => qr/.*/])->to('user#home');
+ $user->get('/journal/:id' => [nickname => qr/.*/])->to('journal#single');
$user->get('/journals' => [nickname => qr/.*/])->to('user#journals');
$user->get('/journal' => [nickname => qr/.*/])->to('user#journals'); # for compatibility
$user->get('/comments' => [nickname => qr/.*/])->to('user#comments');
$user->get('/fans' => [nickname => qr/.*/])->to('user#fans');
$user->get('/freaks' => [nickname => qr/.*/])->to('user#freaks');
$user->get('/achievements' => [nickname => qr/.*/])->to('user#achievements');
- #$r->get('/:user_name/journal' => [user_name => qr/~.*/])->to('journal#user_journals');
}