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

Start of refactor to turn maverick into a plug library #25

Merged
merged 6 commits into from
Feb 9, 2021

Conversation

bbalser
Copy link
Collaborator

@bbalser bbalser commented Jan 16, 2021

No description provided.

Copy link
Owner

@jeffgrunewald jeffgrunewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you planning on using the Api module defined by the user's use Maverick.Api as its own plug? I had pictured this module as the place where you define your application's full Plug pipeline, so having the Api be itself callable as a plug is making me wonder where you'd include that?

lib/maverick/api/initializer.ex Outdated Show resolved Hide resolved
lib/maverick/api/initializer.ex Outdated Show resolved Hide resolved
lib/maverick/api/initializer.ex Outdated Show resolved Hide resolved
end
end

describe "ssl" do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we comment these out so we know to refactor them to accommodate how Plug lets you set up a server using SSL?

lib/maverick/api/initializer.ex Outdated Show resolved Hide resolved
lib/maverick/api.ex Show resolved Hide resolved
lib/maverick/api/generator.ex Outdated Show resolved Hide resolved
Module.register_attribute(__MODULE__, :maverick_routes, accumulate: true)
Module.put_attribute(__MODULE__, :maverick_route_scope, unquote(scope))

@on_definition Maverick
@before_compile Maverick

def call(%Plug.Conn{private: %{maverick_route: route}} = conn, _opts) do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dammit, that's inspired

@bbalser bbalser marked this pull request as ready for review February 9, 2021 02:17
@bbalser bbalser merged commit 7dd3817 into main Feb 9, 2021
@bbalser bbalser deleted the embrace_the_plug branch February 9, 2021 02:18
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

Successfully merging this pull request may close these issues.

2 participants