TramwayJS

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

ArgumentCommand TypeTypeDefaultRequiredComments
resourceargumentstringnoneyesThe name of the Resource to use for all naming
provideroptionstringnoneyesAdds 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