-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #445 from binaryseed/add-bandit
Add Bandit HTTP server support
- Loading branch information
Showing
10 changed files
with
239 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
examples/apps/phx_example/lib/phx_example_web/bandit_endpoint.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
defmodule PhxExampleWeb.BanditEndpoint do | ||
use Phoenix.Endpoint, otp_app: :phx_example | ||
|
||
@session_options [ | ||
store: :cookie, | ||
key: "_phx_example_key", | ||
signing_salt: "F6n7gjjvL6I61gUB", | ||
same_site: "Lax" | ||
] | ||
|
||
socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]] | ||
|
||
plug Plug.Static, | ||
at: "/", | ||
from: :phx_example, | ||
gzip: false, | ||
only: PhxExampleWeb.static_paths() | ||
|
||
plug Plug.RequestId | ||
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint] | ||
|
||
plug Plug.Parsers, | ||
parsers: [:urlencoded, :multipart, :json], | ||
pass: ["*/*"], | ||
json_decoder: Phoenix.json_library() | ||
|
||
plug Plug.MethodOverride | ||
plug Plug.Head | ||
plug Plug.Session, @session_options | ||
plug PhxExampleWeb.Router | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.