What options do I have to identiy the runtime version of slim?

Hi, I am a newbie in the Slim Framework.
At other Frameworks I am working with, I am always interested in identifying at runtime what version is running.
This helps third party monitoring and test tools to find out, which version works better.
For the moment, I am working with something like this.

use Slim\Factory\AppFactory;
use Slim\App;

$app->get('/version', function (Request $request, Response $response, $args) {
       $response->getBody()->write('{"Version":"' . App::VERSION . '"}');
    return $response->withHeader('Content-Type', 'application/json');;

Maybe there is a simpler approach available.

Welcome @matjung :slight_smile:

Reading the App::VERSION constant looks fine to me.

I would recommend to use json_encode to generate a valid JSON string.