first commt
This commit is contained in:
31
routes/api.php
Normal file
31
routes/api.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\RainfallController;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider and all of them will
|
||||
| be assigned to the "api" middleware group. Make something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::post('/login', [AuthController::class, 'login'])->name('login');
|
||||
Route::post('/register', [AuthController::class, 'register'])->name('register');
|
||||
|
||||
Route::middleware('auth:sanctum')->group(function () {
|
||||
Route::get('/user', [AuthController::class, 'user'])->name('user');
|
||||
Route::delete('/logout', [AuthController::class, 'logout'])->name('logout');
|
||||
|
||||
Route::get('rainfalls/last', [RainfallController::class, 'lastRainfalls'])->name('rainfalls.last');
|
||||
Route::get('rainfalls/graph', [RainfallController::class, 'graphValue'])->name('rainfalls.graph');
|
||||
|
||||
Route::post('rainfalls', [RainfallController::class, 'store'])->name('rainfall.store');
|
||||
// Route::resource('rainfalls', RainfallController::class);
|
||||
});
|
||||
Reference in New Issue
Block a user