TramwayJS

Route

Will add the necessary routing config to the routes file in the config folder and optionally create the corresponding Controller file with its index.

Example

tramway create:route ProductController getOne /products --methods get --args id --create-controller

Options

ArgumentCommand TypeTypeDefaultRequiredComments
controllerargumentstringnoneyesThe name of the Controller class associated to the route
actionargumentstringnoneyesThe name of the method in the Controller class associated to the route
pathargumentstringnonenoThe url path of the route
methodsoptionarraynonenoAn array of http methods the route accepts
argsoptionarraynonenoAn array of arguments the url accepts
create-controlleroptionbooleanfalsenoA flag set to indicate a Controller and corresponding function stub should be generated by the command
diroptionstringconfignoAn option to override the default folder the routing config will be placed in
controller-diroptionstringcontrollersnoAn option to override the default folder where controllers are stored
filenameoptionstringroutesnoAn option to override the default name of the routing config file