plug_rest v0.14.0 mix plug_rest.gen.resource View Source
Generates a PlugRest resource in your Plug application.
mix plug_rest.gen.resource UserResource
The generator will add the following files to lib/
:
- a resource file in lib/my_app/resources/user_resource.ex
The resource file path can be set with the --path
option:
mix plug_rest.gen.resource UserResource --path "lib/my_app_web/resources"
By default the resource module will be named like MyApp.UserResource
. This
can be overridden with the --namespace
option:
mix plug_rest.gen.resource User --namespace MyApp.Resources
In an umbrella project, run the mix task in the root of the app, or specify the app with:
mix plug_rest.gen.resource UserResource --app my_app
To create a resource with no tutorial comments:
mix plug_rest.gen.resource UserResource --no-comments
Link to this section Summary
Link to this section Functions
A task needs to implement run
which receives
a list of command line args.
Callback implementation for Mix.Task.run/1
.