Coder Social home page Coder Social logo

plug_cowboy's Introduction

Plug.Cowboy

Hex.pm Version Build Status

A Plug Adapter for the Erlang Cowboy web server.

Installation

You can use plug_cowboy in your project by adding the dependency:

def deps do
  [
    {:plug_cowboy, "~> 2.0"},
  ]
end

You can then start the adapter with:

Plug.Cowboy.http MyPlug, []

Supervised handlers

The Plug.Cowboy module can be started as part of a supervision tree like so:

defmodule MyApp do
  # See https://hexdocs.pm/elixir/Application.html
  # for more information on OTP Applications
  @moduledoc false

  use Application

  def start(_type, _args) do
    # List all child processes to be supervised
    children = [
      {Plug.Cowboy, scheme: :http, plug: MyApp, port: 4040}
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

Contributing

We welcome everyone to contribute to Plug.Cowboy and help us tackle existing issues!

  • Use the issue tracker for bug reports or feature requests.
  • Open a pull request when you are ready to contribute.
  • Do not update the CHANGELOG.md when submitting a pull request.

License

Plug.Cowboy source code is released under Apache License 2.0. Check the LICENSE file for more information.

plug_cowboy's People

Contributors

adrianomitre avatar asabil avatar asonge avatar aweiker avatar binaryseed avatar blatyo avatar chulkilee avatar darrenclark avatar drewolson avatar ericmj avatar gazler avatar idyll avatar josevalim avatar kianmeng avatar luisfmcalado avatar mbuhot avatar mitchellhenke avatar mobileoverlord avatar narkq avatar nathanl avatar pragtob avatar ryanzidago avatar ujihisa avatar voltone avatar whatyouhide avatar wojtekmach avatar yanshiyason avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.