Skip to content

Custom prefix routes in RouteServiceProvider.php #887

Description

@mhsilva555

I added a custom prefix to my api's routes. But the answer is always 404.

Code:

Route::prefix('api/v1')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api/v1/api.php'));

File Endpoints: routes/api/v1/api.php
Code:

Route::get('custom-endpoint', function () {
wp_send_json( 200 );
});

Return: Sorry, the page you are looking for could not be found

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions