phoenix_rest v0.7.0 mix phx_rest.gen.resource

Generates a PlugRest resource in your Phoenix application.

mix phx_rest.gen.resource UserResource

The generator will add the following files to lib/:

  • a resource file in lib/my_app_web/resources/user_resource.ex

To place the resource under lib/my_app/web instead, use the --path and --namespace options:

mix phx_rest.gen.resource UserResource --path "lib/my_app/web/resources" --namespace MyApp.Web

To create a resource with no tutorial comments:

mix phx_rest.gen.resource UserResource --no-comments

Link to this section Summary

Functions

Raises on umbrella application.

A task needs to implement run which receives a list of command line args.

Link to this section Functions

Link to this function

no_umbrella!(task)

Raises on umbrella application.

A task needs to implement run which receives a list of command line args.

Callback implementation for Mix.Task.run/1.