SPT-dev 250d7a6d37 fix: Fixing 404 on search url (#33)
Fixing 404 error on https://db.sp-tarkov.com/search and subpaths (https://db.sp-tarkov.com/search/5cc9a96cd7f00c011c04e04a for example)

![image](/attachments/45627308-515f-4f49-9932-0e0234c653fe)
2023-03-02 21:36:35 -05:00

35 lines
1.0 KiB
PHP

<?php
/** @var \Laravel\Lumen\Routing\Router $router */
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/', function () {
return view('app');
});
$router->get('/search', function () {
return view('app');
});
$router->group(['prefix' => 'search'], function () use ($router) {
$router->get('/{id}', function() {return view('app');});
});
$router->group(['prefix' => 'api'], function () use ($router) {
$router->get('locales', 'ItemController@getLocales');
$router->get('refresh', 'ItemController@refreshAllCache');
$router->post('search', 'ItemController@search');
$router->get('item/hierarchy', 'ItemController@getHierarchy');
$router->get('item', 'ItemController@getItem');
});