Skip to content

Instantly share code, notes, and snippets.

@localdisk
Last active March 2, 2018 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save localdisk/adc990a65c6278f27b62 to your computer and use it in GitHub Desktop.
Save localdisk/adc990a65c6278f27b62 to your computer and use it in GitHub Desktop.
Laravel で簡易Webサーバー
<?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