I have just installed Dingo and it appear to work with the following URL:
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->get('test', function () {
return 'Test';
});
$api->get('hello', function () {
return 'Hello';
});
});
I would like version v1 to be included in the URL, how do I get this to work? When I try:
http://website.dev/api/v1/test
I get error:
{
"message": "404 Not Found",
"status_code": 404
}
In the .env
file, I have: API_PREFIX=api
According to Dingo Configuration:
Avoid putting a version number as your prefix or subdomain as versioning is handled via the Accept header.