manuel-rubio
I created Passby, a mock HTTP server written 100% in Elixir with 0 runtime dependencies.
It is designed as a lightweight drop-in replacement for Bypass, keeping the same API and semantics without pulling in plug_cowboy, cowboy, cowlib, or ranch into your test environment.
Quick Example
test "fetches user profile" do
bypass = Passby.open()
Passby.expect_once(bypass, "GET", "/api/users/42", fn conn ->
Passby.Conn.resp(conn, 200, ~s({"id": 42, "name": "Alice"}))
end)
url = "http://127.0.0.1:#{bypass.port}/api/users/42"
assert {:ok, %{"name" => "Alice"}} = MyClient.get_user(url)
end
Links
• Hex.pm: passby | Hex
• HexDocs: passby v0.1.0 — Documentation
• GitHub:
Feedback and contributions are welcome!
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
wojtekmach
This is great! The only thing I’d additionally consider is maybe adding a convenience struct.url field:
or having a separate some kind of
%{url: url} = Passby.start(). In any case, awesome idea with (essentially) zero dependency replacement!Edit: oh, it truly has zero dependencies as you’re re-implementing most commonly used Plug API. That’s interesting!
krasenyp
Very good! I usually prefer to have a real server to test network-touching code. It’s a welcome addition to the ecosystem.
manuel-rubio
I’ve just added this in
passbyv0.1.1 while keeping 100% backward compatibility withBypass:Now
%Passby{}includes the `.url` field, and there’s also a helperPassby.url/1,2:Regarding the zero dependencies, yes, exactly! It relies entirely on standard Erlang/OTP (
:gen_tcp,:inet, and:erlang.decode_packet) and provides a lightweightPassby.Connstruct matchingPlug.Conn’s API conventions. This allows existing tests to migrate cleanly without bringing Cowboy, Ranch, or Plug into the dependency tree.Thanks again for the input!
manuel-rubio
New
passbyv0.2.0, which ensures better compatibility with params (mainly path_params).