Skip to content

Commit c74c343

Browse files
Update Routes.php
1 parent ea5398b commit c74c343

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/Config/Routes.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// Create a new instance of our RouteCollection class.
66
$routes = Services::routes();
7+
$subdomain = getenv('SUB_DOMAIN');
78

89
// Load the system's routing file first, so that the app and ENVIRONMENT
910
// can override as needed.
@@ -34,17 +35,17 @@
3435
$routes->get('/', 'Home::index');
3536

3637
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]);
3839
$routes->get('/', function(){
3940
echo json_encode(array(
4041
"status"=>true,
4142
"message"=>"Read documentation here https://crudigniter.github.io"
4243
));
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]);
4849
$routes->get('/(:any)', function($image_name){
4950
$remoteImage=base_url()."/uploads/".$image_name."";
5051
return redirect()->to($remoteImage);

0 commit comments

Comments
 (0)