You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Simon Vieille c8566ce06c Documentation 5 years ago
app Documentation 5 years ago
bin API: configuration 5 years ago
src Documentation 5 years ago
var API: configuration 5 years ago
web API: configuration 5 years ago
.gitignore Gitignore 5 years ago Documentation 5 years ago
composer.json Symfony: downgrade (FosRest issues) 5 years ago
phpunit.xml.dist ini 5 years ago

An example of API with symfony 3


Download the application

$ git clone
$ cd sf-api-example

Install composer

$ php -r "copy('', 'composer-setup.php');"
$ php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"

Install the application

$ php composer.phar install --ignore-plateform-reqs
$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:update --force
$ php bin/console assets:install --symlink web
$ php bin/console fos:js-routing:dump --target web/bundles/fosjsrouting/js/fos_js_routes.js

At each updates of API:

  • edit app/config/rest.yml and expose new routes (@see php bin/console debug:router)
  • run php bin/console fos:js-routing:dump --target web/bundles/fosjsrouting/js/fos_js_routes.js.


$ php bin/console server:start