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