Last active
March 2, 2018 01:23
-
-
Save localdisk/adc990a65c6278f27b62 to your computer and use it in GitHub Desktop.
Laravel で簡易Webサーバー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('show', function() | |
{ | |
$article = ['id' => 1, 'title' => "today's dialy", 'content' => "It's a sunny day."]; | |
return Response::json($article); | |
}); | |
Route::post('edit', function() | |
{ | |
$body = Input::all(); | |
if (empty($body)) { | |
return App::abort(400); | |
} | |
return Response::json($body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment