routes.php 868 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Application Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register all of the routes for an application.
  8. | It's a breeze. Simply tell Laravel the URIs it should respond to
  9. | and give it the Closure to execute when that URI is requested.
  10. |
  11. */
  12. Route::get('/json', function()
  13. {
  14. return Response::json(array('message' => 'Hello, World!'));
  15. });
  16. Route::get('/plaintext', function()
  17. {
  18. return "Hello, World!";
  19. });
  20. Route::get('/db', function()
  21. {
  22. $queries = Input::get('queries', 1);
  23. $worlds = array();
  24. for($i = 0; $i < $queries; ++$i) {
  25. $worlds[] = DB::table('World')->find(mt_rand(1, 10000));
  26. }
  27. return Response::json($worlds);
  28. });
  29. Route::get('/fortunes', 'BenchController@fortunes');