get('projects_manager'); $app->match('/projects', function (Request $req) use($projectsManager) { $data = json_decode($req->getContent()); return $projectsManager->createProject($data->name, $data->description); }); $app->run();