Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin mode #107

Open
falood opened this issue Jul 17, 2018 · 0 comments
Open

plugin mode #107

falood opened this issue Jul 17, 2018 · 0 comments

Comments

@falood
Copy link
Member

falood commented Jul 17, 2018

make some dsl standalone and import as plugin.

plugin defined in the server module,

defmodule MyServer do
  use Maru.Server, otp_app: :my_api

  plugin Version, using: :param, parameter: "v"
end

when plugin defined in the server, we can use custom dsl in router code.
The version dsl is defined by plugin.

defmodule MyRouter do
  use MyServer

  version "v1"
end

Plugin only works for routers use MyServer.

keep such DSLs internal

prefix
namespaces/route_param
desc
params
get/post
plug/plug_overridable
rescue_from

move such DSLs to plugin

version
mount
extend
pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant