Installation

Télécharger le projet

Une fois le projet récupéré vous pouvez lancer l'installation avec composer install

Pour installer api-platform dans le projet c'est avec la commande composer require api-platform/core "2.6"

Could not resolve host: flex.symfony.com

Si vous avez cette erreur

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
The following exception probably indicates you have misconfigured DNS resolver(s)

In CurlDownloader.php line 375:

  curl error 6 while downloading https://flex.symfony.com/versions.json: 

Could not resolve host: flex.symfony.com 

Lancez simplement composer update symfony/flex --no-plugins --no-scripts https://github.com/symfony/flex/issues/909

Routes

On peut vérifier que l'installation s'est bien passée en faisant php bin console debug:routeur

/var/www/html # php bin/console debug:router
 -------------------------- -------- -------- ------ -------------------------------------
  Name                       Method   Scheme   Host   Path
 -------------------------- -------- -------- ------ -------------------------------------
  _preview_error             ANY      ANY      ANY    /_error/{code}.{_format}
  _wdt                       ANY      ANY      ANY    /_wdt/{token}
  _profiler_home             ANY      ANY      ANY    /_profiler/
  _profiler_search           ANY      ANY      ANY    /_profiler/search
  _profiler_search_bar       ANY      ANY      ANY    /_profiler/search_bar
  _profiler_phpinfo          ANY      ANY      ANY    /_profiler/phpinfo
  _profiler_search_results   ANY      ANY      ANY    /_profiler/{token}/search/results
  _profiler_open_file        ANY      ANY      ANY    /_profiler/open
  _profiler                  ANY      ANY      ANY    /_profiler/{token}
  _profiler_router           ANY      ANY      ANY    /_profiler/{token}/router
  _profiler_exception        ANY      ANY      ANY    /_profiler/{token}/exception
  _profiler_exception_css    ANY      ANY      ANY    /_profiler/{token}/exception.css
  api_entrypoint             ANY      ANY      ANY    /api/{index}.{_format}
  api_doc                    ANY      ANY      ANY    /api/docs.{_format}
  api_jsonld_context         ANY      ANY      ANY    /api/contexts/{shortName}.{_format}
 -------------------------- -------- -------- ------ -------------------------------------

En vous rendant sur http://localhost:8080/api/docs vous pourrez découvrir la page de documentation d'api-platform

api-platform doc page next

Commentaires

Connectez-vous pour laisser un commentaire