Appearance
CLI Commands
CLI Commands in the CMS makes easy to genarate and scafold the module specific folders and files.
make:middleware
yarn make:middleware name=testMiddlewareAs this command will generate the controller file in the (src/middlewares) directory.
make:route
yarn make:route name=testRouteAs this command will generate the controller file in the (src/routes) directory.
make:validator
yarn make:validator name=testValidatorAs this command will generate the controller file in the (src/validators) directory.
make:controller
yarn make:controller name=testControllerAs this command will generate the controller file in the (src/controllers) directory.
make:service
yarn make:service name=testServiceAs this command will generate the service file in the (src/services) directory.
make:model
yarn make:model name=testModelAs this command will generate the model file in the (src/models) directory.
generate:scafold
yarn generate:scafold name=UsersAs this command will generate the route, model, controller and service files and if sub-directory is passed it will be generate according to it.
Likewise, these all commands also supports the sub-folder structure. So in order to create the file in the specific folder we can execute like:
yarn make:controller name=backend\users\userControllerAS this command will create the userController.js file under src/controllers/backend/users. If file already exists error is thrown.