Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

phoenix framework - What is Elixir Plug?

As a newcomer to both Elixir and the web domain in general (no web framework experience) I would like to know, what is Plug? As I understand it Cowboy is a web server (albeit in Erlang, not Elixir) and Phoenix is a framework for building web apps, but where does Plug come in? Is it an abstraction layer between the two or perhaps a plug-in system in the same abstraction layer as Phoenix?

question from:https://stackoverflow.com/questions/26304727/what-is-elixir-plug

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Is it an abstraction layer between the two

Yes, exactly! Plug is meant to be a generic adapter for different web servers. Currently we support just Cowboy but there is work to support others.

Plug also defines how different components should be plugged together. Similar to Rack in Ruby, WSGI in Python, Ring in Clojure, and so on.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...