$app->get('/hello/{name}', function ($request, $response, $args) { $name = $args['name']; $response->getBody()->write("Hello, $name"); return $response; });In this example, we define a route at "/hello/{name}" that responds to GET requests. The {name} segment of the URL is a placeholder that can be any string. The function that handles the request simply retrieves the value of {name} from the route arguments, writes a message to the response body, and returns it. The package library used in this example is Slim Framework's core library, which provides the basic functions and classes required for building web applications. Slim also has a variety of optional packages that can be installed for more advanced functionality, such as database management or authentication.