How to bootstrap Slim 4 (a Slim Instance outside the slim folder)?

Hello guys,
How is the best way to bootstrap Slim 4? For example if you have worldpress running on your local server you can get an instance of worldpress to to all the actions you want. I would like to see something similar for Slim.

If we copy the content of index.php from the public. What are the modifications that need to be done and what method to execute a route or Controller for example and get a result.


I take a copy of index.php I comment out as follow:

// Run App & Emit Response

$response = $app->handle($request);

//$responseEmitter = new ResponseEmitter();


I will use $lastrep=(string) $response->getBody(); somewhere.

The part to handle a fake request is missing now.