allerta-vvf/backend/routes/api.php

27 lines
854 B
PHP
Raw Normal View History

2023-02-19 01:40:12 +01:00
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
/*
|--------------------------------------------------------------------------
| 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('/register', [AuthController::class, 'register']);
Route::post('/login', [AuthController::class, 'login']);
2023-02-23 00:23:56 +01:00
Route::middleware('auth:sanctum')->group( function () {
Route::get('/me', [AuthController::class, 'me']);
Route::post('/me', [AuthController::class, 'me']);
Route::post('/logout', [AuthController::class, 'logout']);
2023-02-19 01:40:12 +01:00
});