API
Will create all the necessary classes and mappings to have a full API ready. The routes follow REST and are automatically mapped to their controller action with services instantiated and linked in the Dependency Injection configuration.
Example
tramway create:api Product --provider provider.mysql
Options
Argument | Command Type | Type | Default | Required | Comments |
---|---|---|---|---|---|
resource | argument | string | none | yes | The name of the Resource to use for all naming |
provider | option | string | none | yes | Adds a provider key to the Repository declaration to link them |
Result
This command will create the following new files and update corresponding index.js files, as well as configuration files:
+ config++ services+- services.js+- repositories.js+- factories.js+- controllers.js+- routes.js+ entities+- Product.js+ controllers+- ProductController.js+ services+- ProductService.js+ repositories+- ProductRepository.js+ factories+- ProductFactory.js