From 530e267da95441cdd35ce312e78d9bc9fb5c7e62 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 6 Oct 2014 08:11:53 -0700 Subject: [PATCH] adds a route to return the list of food options in JSON format --- controllers/controllers.php | 7 +++++++ public/images/teacup-pixel.png | Bin 0 -> 1033 bytes 2 files changed, 7 insertions(+) create mode 100644 public/images/teacup-pixel.png diff --git a/controllers/controllers.php b/controllers/controllers.php index ed871c0..c212a43 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -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) { diff --git a/public/images/teacup-pixel.png b/public/images/teacup-pixel.png new file mode 100644 index 0000000000000000000000000000000000000000..9a8071228295260487788619fb6442e8b3d332cc GIT binary patch literal 1033 zcmaJ=&ui0A9M3Gs91O=`%0wY#Lnf^G)iiCh)vaw>S2S~Wwd>I|d0WGpyexUM>AZ;G zaCZ+w4_-Wo0|oIQOqsaT{sl#J4sTV#i(WQ->DtbNH6(fOeffMo-=A-7X8KZZ&zT;A zAbPV?at^O&{jd8N{_n%7ZM+PkbP>(Mc~n&$KqPcn0%X=y7eEfEdTnV3j1xp)*vJ=A zQMn>%(48p2)hb;L(a>37 zxL7RaYw&y!BZ6+tLaG|2`2=(#g(D9Yyu0lxcU*7@5uFs!L+ew892sGpl2Ltl8vM#qhl&YSMMAP z+mXxQU>Lu(f3>=0!t>*A+k=Y_?a>Doo_7ZicK4t>j4#EltenVu@9X!+`rne>^4;Bo zx$}kfoqLaZg|+;t?}2Jz>iT80lzkG|59RB!yjf!QO3}}!y=337$+>rLx|B~Z`1(`k z_SWi`ky7FDgMr