Closed rubenssb closed 4 years ago
Slim does not have pipe()
method. Instead it uses add()
.
$app->add(new Tuupola\Middleware\CorsMiddleware);
Thanks, @tuupola
Now, I have this error with the line above:
$app->add(new Tuupola\Middleware\CorsMiddleware);
Error: Fatal error: Uncaught Error: Class 'Tuupola\Middleware\CorsMiddleware' not found
If, I change the class to Cors, I have other error:
$app->add(new Tuupola\Middleware\Cors);
Error: Fatal error: Uncaught TypeError: Argument 1 passed to Slim\Slim::add() must be an instance of Slim\Middleware, instance of Tuupola\Middleware\Cors given...
Looking at the error message:
Error: Fatal error: Uncaught TypeError: Argument 1 passed to Slim\Slim::add()
must be an instance of Slim\Middleware, instance of Tuupola\Middleware\Cors given...
Are you running Slim 2? It is not supported. This middleware can be used with Slim 3 or higher.
@tuupola I checked here and my PHP version is 7.2.18. I'm using WAMP server locally.
My Slim version is 3.12.2
Cors Middleware is normally installed with composer.
My index.php of API is:
I have a error with the line
Fatal error: Uncaught Error: Call to undefined method Slim\Slim::pipe() in C:\wamp64\www\tabela-fipe\backend\tabelafipe-backend\api\index.php on line 15
Is slim the problem here?