I am trying to make a simple API that will print cars for me. So far I made a 3 simple routes:
$app('/api/cars', function($req, $res, $arg) {
//Display all cars
});
$app('/api/cars/{brand}', function($req, $res, $arg) {
//Display all cars based on brand
});
$app('/api/cars/{brand}/{model}', function($req, $res, $arg) {
//Display all cars based on brand
});
And it works just fine. But what if I want to display cars with "?" color? let's say:
api/cars/red I am unable to.
I can't really do that, because it's looking for a brand name instead of a color.