nitrogen/simple_bridge
59.5
Adequate · 2 October 2026
3.7k
lines of production code
Erlang
primary language
2
measurements over time
What this system is
Simple Bridge is an Erlang library that provides a unified interface for building HTTP applications across multiple web server backends, including Cowboy, Mochiweb, Inets, Webmachine, and Yaws. It standardizes request and response handling, cookie management, and multipart file uploads, allowing developers to write backend-agnostic code. The system manages server lifecycle and routing through dedicated bridge modules for each supported HTTP server.
How it got here
2009 — Build system migration and upload handling
4 changes.
The project migrated its build infrastructure to rebar3, expanding support for multiple HTTP backends and integrating modern CI checks. Concurrently, core record definitions were refactored to standardize data structures, and a unified mechanism for handling file uploads and multipart form data was introduced.
2012–2015 — Multi-backend bridge implementation
8 changes.
This period focused on implementing the Simple Bridge framework to enable Erlang applications to run on multiple web server backends, including Cowboy, Yaws, Webmachine, Mochiweb, and Inets. The work involved creating adapter modules for each backend to map their specific APIs to a unified interface, supporting both standard HTTP and WebSocket connections. Additionally, initial configuration templates, compatibility scripts for different Erlang versions, and a test suite for request handling were established.
Features
Add Cowboy HTTP server bridge support
Introduces a new bridge module for the Cowboy HTTP server, enabling the application to run on Cowboy in addition to existing backends. This includes a supervisor module to start the Cowboy server with configurable dispatch tables (supporting static file serving via cow\_mimetypes and custom dispatch functions), an anchor module handling both standard HTTP requests and WebSocket upgrades with keepalive support, and a request/response handler module that maps Cowboy's API to the simple\_bridge interface, including support for map-based headers and binary cookies.
_src/cowboy\_bridge\modules · high confidence
Add Inets backend support for Simple Bridge
Introduces a new Inets-based backend for the Simple Bridge framework, enabling Erlang applications to serve HTTP requests using the built-in inets HTTP server. The change adds three new modules: \inets\_simple\_bridge.erl\ implements the bridge behavior to map inets request records to the simple\_bridge interface (handling headers, cookies, query params, and response building); \inets\_simple\_bridge\_anchor.erl\ acts as the entry point, routing requests to static file handlers, WebSocket hijacking, or custom handlers; and \inets\_simple\_bridge\_sup.erl\ manages the inets application lifecycle, dynamically configuring the HTTP server (including mimetypes and log directories) if no existing configuration is found.
_src/inets\_bridge\modules · high confidence
Add Mochiweb backend bridge with cookie SameSite support
This change introduces the Mochiweb adapter for the simple\_bridge framework, including the core request/response handling module, the supervisor for starting the Mochiweb server, and the anchor module that routes requests to handlers or static files. Users can now run their applications on Mochiweb, with full support for parsing request data and building responses. Notably, the cookie handling in the response builder now supports the \same\_site\ attribute, allowing for more secure cookie configuration.
_src/mochiweb\_bridge\modules · high confidence
Add Webmachine integration via Simple Bridge
Introduces a new bridge module that allows applications to run on the Webmachine framework using the Simple Bridge interface. This includes a core request/response handler, a supervisor to start the Webmachine server and configure dispatch routes, a static file handler for serving assets, and an anchor module that routes requests to the application handler while supporting WebSocket hijacking.
_src/webmachine\_bridge\modules · high confidence
Added WebSocket demo and Erlang compatibility generation script
This change introduces two new files in the priv directory to support development and compatibility. The new priv/static/js/websocket.js file provides a client-side JavaScript interface for testing WebSocket connections, including connection management, message sending/receiving, and status display. Additionally, the new priv/compat.escript is an Erlang script that generates a compatibility header file (include/compat.hrl) by detecting available Erlang/OTP functions (crypto:hash, maps:filter, rand:uniform, uri\_string:dissect\_query) and writing appropriate macro definitions to support both older and newer Erlang versions.
priv · high confidence
Initial configuration file for Simple Bridge
Added etc/simple\_bridge.config, a default configuration file for the Simple Bridge application. It defines standard settings such as the server name, handler module, bind address, and port, along with file upload limits (max post size, max file size, memory retention threshold) and a scratch directory. It also includes commented-out sections for backend-specific configurations (Cowboy, Webmachine) and static path handling, providing a template for users to customize their deployment.
etc · high confidence
Introduce unified file upload handling and multipart parsing
The library now provides a built-in mechanism for handling file uploads via the new \sb\_file\_upload\_handler\ module, which supports storing uploaded data either in memory or as temporary files on disk based on configurable size limits. This handler is integrated into the \simple\_bridge\_multipart\ parser, which now processes multipart form data and exposes uploaded files through the \sb\_uploaded\_file\ record (accessible via the \sb\_uploaded\_file\ module). This change replaces the previous ad-hoc or backend-specific upload logic with a standardized, configurable approach for all supported HTTP backends.
src · high confidence
Yaws bridge implementation for Simple Bridge
The Yaws adapter for Simple Bridge is now implemented, allowing applications to run on the Yaws web server. This change introduces \yaws\_simple\_bridge.erl\ to handle HTTP request and response mapping (including headers, cookies, and query parameters), \yaws\_simple\_bridge\_anchor.erl\ to manage WebSocket connections and keepalive logic, and \yaws\_simple\_bridge\_sup.erl\ to automatically configure and start the embedded Yaws server based on application settings.
_src/yaws\_bridge\modules · high confidence
Behavioural changes
Migration to rebar3 and expanded backend support
The project has migrated its build system from a custom Makefile/Emakefile setup to rebar3, introducing profile-based builds for Cowboy, Mochiweb, Inets, Webmachine, and Yaws. This change adds native support for the Cowboy HTTP server and updates the Travis CI configuration to test against Erlang/OTP versions 21.3, 22.3, and 23.0. The build process now includes dialyzer checks for all backends and updates the Makefile to facilitate running demos and tests for each supported server.
(repo-wide) · high confidence
Refactored core record definitions and type specifications
The core include files have been reorganized to improve clarity and support new features. The legacy \simplebridge.inc\ file has been removed and replaced by \simple\_bridge.hrl\, which introduces updated record definitions for \cookie\ (now including \same\_site\, \http\_only\, and \secure\ attributes), \response\, and \header\. A new \sbw\ (Simple Bridge Wrapper) record has been added to centralize request and response state, and type specifications for bridge types (e.g., cowboy, yaws) and data structures are now explicitly defined. Additionally, the \sb\_uploaded\_file\ record now includes a \field\_name\ attribute to better handle multipart form data.
include · high confidence
Test coverage
Initial Common Test suite for simple\_bridge request handling and file uploads
Added a new Common Test suite (simple\_bridge\_SUITE and simple\_bridge\_multipart\_SUITE) that validates core request features—including peer IP, protocol, path, URI, host, query/post parameters, and cookies—across supported backends, and verifies multipart file upload behavior with size limits.
test · high confidence
Housekeeping
Updated .gitignore to exclude compiled BEAM and app files
The .gitignore file in the ebin directory has been updated to explicitly ignore \.beam and \.app files, ensuring that compiled Erlang bytecode and application resource files are no longer tracked in version control.
ebin · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 57 → 59 (+2.2)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 96 → 96 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 58 → 58 (+0.0)
- Readiness 41 → 46 (+4.7)
- Security 67 → 67 (+0.0)
- Event Sourcing 100 → 100 (+0.0)
Resolved (5)
- Coverage not measured — no coverage collector is wired up
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Off-boarding risk: anonymized user #1
New (2)
- Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nitrogen/simple_bridge was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b875e6adb74fb851702cb531f28740f035b26373 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.