|
@@ -66,13 +66,17 @@ $app->post('/register', $withCors(\Controllers\RegisterController::class));
|
|
|
$app->options('/register', $handleOptions);
|
|
$app->options('/register', $handleOptions);
|
|
|
|
|
|
|
|
//Rotas Category
|
|
//Rotas Category
|
|
|
-$app->get('/category', \Controllers\CategoryController::class);
|
|
|
|
|
-$app->post('/category', \Controllers\CategoryController::class);
|
|
|
|
|
-$app->post('/category/delete', \Controllers\CategoryController::class);
|
|
|
|
|
-$app->post('/category/add-product', \Controllers\CategoryController::class);
|
|
|
|
|
|
|
+$app->get('/category', $withCors(\Controllers\CategoryController::class));
|
|
|
|
|
+$app->post('/category', $withCors(\Controllers\CategoryController::class));
|
|
|
|
|
+$app->options('/category', $handleOptions);
|
|
|
|
|
+$app->post('/category/delete', $withCors(\Controllers\CategoryController::class));
|
|
|
|
|
+$app->options('/category/delete', $handleOptions);
|
|
|
|
|
+$app->post('/category/add-product', $withCors(\Controllers\CategoryController::class));
|
|
|
|
|
+$app->options('/category/add-product', $handleOptions);
|
|
|
|
|
|
|
|
//Rotas Product
|
|
//Rotas Product
|
|
|
-$app->get('/product', \Controllers\ProductController::class);
|
|
|
|
|
-$app->post('/product', \Controllers\ProductController::class);
|
|
|
|
|
|
|
+$app->get('/product', $withCors(\Controllers\ProductController::class));
|
|
|
|
|
+$app->post('/product', $withCors(\Controllers\ProductController::class));
|
|
|
|
|
+$app->options('/product', $handleOptions);
|
|
|
|
|
|
|
|
$app->run();
|
|
$app->run();
|