Browse Source

adds a route to return the list of food options in JSON format

pull/10/head
Aaron Parecki 9 years ago
parent
commit
530e267da9
2 changed files with 7 additions and 0 deletions
  1. +7
    -0
      controllers/controllers.php
  2. BIN
      public/images/teacup-pixel.png

+ 7
- 0
controllers/controllers.php View File

@ -50,6 +50,13 @@ $app->get('/new', function() use($app) {
} }
}); });
$app->get('/new/options.json', function() use($app) {
$app->response()['Content-Type'] = 'application/json';
$app->response()->body(json_encode(array(
'Caffeine' => caffeine_options(),
'Alcohol' => alcohol_options()
)));
});
$app->post('/prefs', function() use($app) { $app->post('/prefs', function() use($app) {

BIN
public/images/teacup-pixel.png View File

Before After
Width: 28  |  Height: 28  |  Size: 1.0 KiB

Loading…
Cancel
Save