(03-07-2022, 06:41 PM)spreaderman Wrote: Why would one work and not the other though?
Auto routes and Defined routes are different mechanism.
The rule "Folder names MUST start with an uppercase letter and ONLY the first character can be uppercase."
is a rule in auto routes.
If you define a route, it defines the exact controller name to run. The above uppercase rule does not applied.
Your controller is `\App\Controllers\Api\v1\User`. So it is not possible to reach by auto-routing.
I recommend you disable auto routes and define all routes in the Routes.php.
Because it is more secure for human beings.
In your Routes file:
PHP Code:
$routes->group("/api/v1", ["namespace" => 'App\Controllers\Api\V1'] , function($routes){
Your namespace should be
'App\Controllers\Api\v1'.
In your testmethod:
Code:
$get_endpoint = '/api/v1/add';
It should be
'/app/v1/user/add'.