|
4 | 4 |
|
5 | 5 | // Create a new instance of our RouteCollection class.
|
6 | 6 | $routes = Services::routes();
|
| 7 | +$subdomain = getenv('SUB_DOMAIN'); |
7 | 8 |
|
8 | 9 | // Load the system's routing file first, so that the app and ENVIRONMENT
|
9 | 10 | // can override as needed.
|
|
34 | 35 | $routes->get('/', 'Home::index');
|
35 | 36 |
|
36 | 37 | if(getenv('SUB_DOMAIN_ENABLE') == true){
|
37 |
| - $routes->post('/(:any)', 'Create::index/$1' ,['subdomain' => getenv('SUB_DOMAIN')]); |
| 38 | + $routes->post('/(:any)', 'Create::index/$1' ,['subdomain' => $subdomain]); |
38 | 39 | $routes->get('/', function(){
|
39 | 40 | echo json_encode(array(
|
40 | 41 | "status"=>true,
|
41 | 42 | "message"=>"Read documentation here https://crudigniter.github.io"
|
42 | 43 | ));
|
43 |
| - } ,['subdomain' => getenv('SUB_DOMAIN')]); |
44 |
| - $routes->get('/(:any)', 'Read::index/$1' ,['subdomain' => getenv('SUB_DOMAIN')]); |
45 |
| - $routes->put('/(:any)', 'Update::index/$1' ,['subdomain' => getenv('SUB_DOMAIN')]); |
46 |
| - $routes->patch('/(:any)', 'Update::index/$1' ,['subdomain' => getenv('SUB_DOMAIN')]); |
47 |
| - $routes->delete('/(:any)', 'Delete::index/$1' ,['subdomain' => getenv('SUB_DOMAIN')]); |
| 44 | + } ,['subdomain' => $subdomain]); |
| 45 | + $routes->get('/(:any)', 'Read::index/$1' ,['subdomain' => $subdomain]); |
| 46 | + $routes->put('/(:any)', 'Update::index/$1' ,['subdomain' => $subdomain]); |
| 47 | + $routes->patch('/(:any)', 'Update::index/$1' ,['subdomain' => $subdomain]); |
| 48 | + $routes->delete('/(:any)', 'Delete::index/$1' ,['subdomain' => $subdomain]); |
48 | 49 | $routes->get('/(:any)', function($image_name){
|
49 | 50 | $remoteImage=base_url()."/uploads/".$image_name."";
|
50 | 51 | return redirect()->to($remoteImage);
|
|
0 commit comments