{"id":37016475,"url":"https://github.com/remast/marga","last_synced_at":"2026-01-14T01:51:47.795Z","repository":{"id":314748706,"uuid":"1056624150","full_name":"remast/marga","owner":"remast","description":"Ultra-Lightweight Java HTTP Router","archived":false,"fork":false,"pushed_at":"2025-11-29T05:46:35.000Z","size":122,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-10T14:59:08.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-14T13:35:20.000Z","updated_at":"2025-11-01T15:44:55.000Z","dependencies_parsed_at":"2025-09-14T15:37:36.675Z","dependency_job_id":"e8762816-03cb-40a0-9775-0a20d0fe2993","html_url":"https://github.com/remast/marga","commit_stats":null,"previous_names":["remast/marga"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/remast/marga","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fmarga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fmarga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fmarga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fmarga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remast","download_url":"https://codeload.github.com/remast/marga/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fmarga/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T01:51:47.100Z","updated_at":"2026-01-14T01:51:47.790Z","avatar_url":"https://github.com/remast.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Marga - Ultra-Lightweight HTTP Router\n\n**Zero dependencies. Pure Java. Lightning fast.**\n\nMarga is a featherweight HTTP router built from the ground up for Java applications that need simplicity without compromise. No bloated frameworks, no external dependencies, just clean, efficient routing that gets out of your way.\n\n## ✨ Why Marga?\n\n- **🎯 Zero Dependencies** - Pure Java 21, no external libraries\n- **⚡ Virtual Threads** - Built-in support for Java 21's virtual threads\n- **🔧 Simple API** - Intuitive routing with minimal boilerplate\n- **📦 Tiny Footprint** - Minimal overhead, maximum performance\n- **🎨 Modern Java** - Leverages latest Java features and best practices\n\n## 🚀 Quick Start\n\nAdd Marga to your project and start building APIs in minutes:\n\n```java\nimport remast.marga.*;\nimport static remast.marga.MediaType.*;\n\npublic class App {\n    public static void main(String[] args) throws IOException {\n        var router = new HttpRouter();\n        \n        // Simple routes\n        router.GET(\"/\", request -\u003e \n            Response.ok(\"\u003ch1\u003eWelcome to Marga!\u003c/h1\u003e\"));\n\n        router.GET(\"/api/users\", request -\u003e \n            Response.ok(\"{\\\"users\\\": []}\")\n                    .mediaType(APPLICATION_JSON));\n            \n        // Parameterized routes\n        router.GET(\"/users/${id}\", request -\u003e {\n            var userId = request.pathParam(\"id\");\n            return Response.ok(\"User ID: \" + userId);\n        });\n        \n        // Run the server\n        router.run();\n    }\n}\n```\n\nThat's it! Your HTTP server is running on `http://localhost:8080` with virtual thread support out of the box.\n\n## 🔧 Middleware Support\n\nMarga includes powerful middleware capabilities with a functional approach:\n\n```java\nvar router = new HttpRouter();\n\n// Add built-in middleware\nrouter.use(LoggingMiddleware.create());\n\n// Authentication middleware\nrouter.use(handler -\u003e request -\u003e {\n    var authHeader = request.getHeader(\"Authorization\");\n    if (authHeader == null) {\n        return Response.unauthorized(\"Missing authorization\");\n    }\n    return handler.handle(request);\n});\n\nrouter.GET(\"/api/protected\", request -\u003e Response.ok(\"Secret data\"));\n```\n\n**Built-in middleware includes:**\n- 📝 **LoggingMiddleware** - Request/response logging\n- ⏱️ **TimingMiddleware** - Performance timing\n- 🗜️ **GzipCompressionMiddleware** - Response compression\n\nSee [MIDDLEWARE.md](MIDDLEWARE.md) for complete middleware documentation.\n\n## 🏗️ Architecture\n\nMarga is designed with simplicity and performance in mind:\n\n- **Parameterized Routes** - Efficient pattern matching with path variables\n- **Virtual Threads** - Fast and scalable with Java 21's virtual threads\n- **Minimal Memory Footprint** - No unnecessary abstractions or overhead\n\n## 📦 Installation\n\n### Maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.remast\u003c/groupId\u003e\n    \u003cartifactId\u003emarga-router\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Requirements\n- Java 21 or higher\n- No external dependencies\n\n## 🎮 Example Application\n\nCheck out the `example` directory for complete examples including:\n- Basic routing\n- Parameterized routes\n- Custom handlers\n- Error handling\n\n---\n\n**Ready to build something amazing?** Start with Marga and experience the joy of simple, efficient HTTP routing in Java! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremast%2Fmarga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremast%2Fmarga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremast%2Fmarga/lists"}