Where, why, and how to define routes in CodeIgniter 4?

In CodeIgniter 4 there is a file named as Route.php where we can define our app route. It is placed in the following location App->config->Route.php In this file we can also change our default controller and function as well as here we can define our whole app route with controller functions>lets see example below how to define route.
$routes->get('/install', 'InstallController::index');
In the above line we define that whenever we write “/install” in URL than in this condition it gets the data for controller named InstallController and index is the function from where data would be received.
$routes->post('/save', 'InstallController::save_Function');
Similarly, if we want to get the data of our form or any type of data we want to get in into the controller then we use the post. According to above code, post define that data will be post here, where InstallController is the name of controller and save_Function is the name of function.
Route.php is the important file for developer by use it we can hide our controller name and function name from the front end user . If we use it then user can only see the url like /install or /save they are not able to see the code of behind it that which controller is used behind this url and which method perfom their task.

how to define routes in CodeIgniter 4?expoundsofttechsolution

how to define routes in CodeIgniter 4?