Skip to content

Commit 2947a9e

Browse files
committed
Fix show ProductController, and CORS
1 parent fa3f1bb commit 2947a9e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

backend/config/cors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
'allowed_methods' => ['*'],
2121

22-
'allowed_origins' => [env('FRONTEND_URL', 'http://localhost:3000')],
22+
'allowed_origins' => [env('FRONTEND_URL', 'http://localhost:3000'), 'http://192.168.100.206:5173'],
2323

2424
'allowed_origins_patterns' => [],
2525

backend/routes/api.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Http\Request;
44
use Illuminate\Support\Facades\Route;
5+
use App\Http\Controllers\ProductController;
56

67
/*
78
|--------------------------------------------------------------------------
@@ -14,6 +15,8 @@
1415
|
1516
*/
1617

18+
Route::resource('products', ProductController::class);
19+
1720
Route::post('/register', App\Http\Controllers\Api\RegisterController::class)->name('register');
1821
Route::post('/login', App\Http\Controllers\Api\LoginController::class)->name('login');
1922
Route::middleware('auth:api')->get('/user', function (Request $request) {

0 commit comments

Comments
 (0)