Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenconde committed May 17, 2019
2 parents 619f7bd + aa400ab commit 36634ef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
12 changes: 11 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => ['json.response']], function () {
Route::group(['middleware' => ['cors']], function () {
Route::prefix('v1')->group(function () {
Route::get('/', function () {
$status = [
"version" => "1.0",
"online" => true
];
$baseController = new BaseController();
return $baseController->sendResponse($status, 'GeoQuizz API Status');
});

Route::middleware('auth:api')->get('/user', function (Request $request) {
$baseController = new BaseController();
return $baseController->sendResponse($request->user(),'User obtained');
return $baseController->sendResponse($request->user(), 'User obtained');
});

// public routes
Expand Down
20 changes: 15 additions & 5 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@
|
*/

Route::get('/', function () {
return view('welcome');
});
use App\Http\Controllers\Api\BaseController;
use Illuminate\Support\Facades\Route;

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/', function () {
$status = [
"versions" => [
"v1" => [
"online" => true,
"deprecated" => false,
"maintenance" => false
]
]
];
$baseController = new BaseController();
return $baseController->sendResponse($status, 'GeoQuizz API Status');
});

0 comments on commit 36634ef

Please sign in to comment.