You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
773 B

  1. <?php
  2. $app->get('/', function() use($app) {
  3. $res = $app->response();
  4. ob_start();
  5. render('index', array(
  6. 'title' => 'Switchboard',
  7. 'meta' => ''
  8. ));
  9. $html = ob_get_clean();
  10. $res->body($html);
  11. });
  12. $app->get('/subscription/:hash', function($hash) use($app) {
  13. $res = $app->response();
  14. $subscription = db\get_by_col('subscriptions', 'hash', $hash);
  15. $feed = db\get_by_id('feeds', $subscription->feed_id);
  16. if(!$subscription) {
  17. $app->response()->status(404);
  18. } else {
  19. ob_start();
  20. render('subscription-status', array(
  21. 'title' => 'Switchboard',
  22. 'meta' => '',
  23. 'subscription' => $subscription,
  24. 'feed' => $feed
  25. ));
  26. $html = ob_get_clean();
  27. $res->body($html);
  28. }
  29. });