{"id":35739222,"url":"https://github.com/he-end/simproute","last_synced_at":"2026-03-07T15:00:48.810Z","repository":{"id":329337873,"uuid":"1119173500","full_name":"he-end/simproute","owner":"he-end","description":"A minimal, lightweight, and EZ-to-use Go HTTP router framework. Features built-in structured logging, route grouping, and panic recovery for efficient API development.","archived":false,"fork":false,"pushed_at":"2026-03-06T18:14:18.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-06T21:48:19.893Z","etag":null,"topics":["api","api-engine","backend","backend-api","framework","frameworks","go","golang","router"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/he-end.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-18T21:33:15.000Z","updated_at":"2026-03-06T18:14:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a520062-7916-4837-87b7-e1b031391abd","html_url":"https://github.com/he-end/simproute","commit_stats":null,"previous_names":["he-end/simproute"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/he-end/simproute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he-end%2Fsimproute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he-end%2Fsimproute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he-end%2Fsimproute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he-end%2Fsimproute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/he-end","download_url":"https://codeload.github.com/he-end/simproute/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he-end%2Fsimproute/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30219217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: 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":["api","api-engine","backend","backend-api","framework","frameworks","go","golang","router"],"created_at":"2026-01-06T14:12:57.689Z","updated_at":"2026-03-07T15:00:48.748Z","avatar_url":"https://github.com/he-end.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"SimpRoute is a lightweight HTTP routing framework for Go (Golang), designed with a minimal code philosophy and ease of use (EZ to use) in mind.\n\nBuilt for developers who need a fast routing solution without complex configurations. Despite being minimalist, SimpRoute comes packed with essential features ready for production environments.\n\nKey Features:\n\n🚀 Easy \u0026 Minimalist: Intuitive API with very low boilerplate code.\n\n🗂️ Route Grouping: Organize your code cleanly with path grouping (e.g., /api/v1/...).\n\n📝 Built-in Logger: Integrated logging system (supports JSON \u0026 Text formats) with dev and prod modes.\n\n🛡️ Panic Recovery: Automatically handles panics to keep your server stable.\n\n🔍 Auto Correlation: Easy request tracking with automatic Request IDs.\n\n🛠️ Standard Compatible: Fully compatible with Go's standard net/http.\n\n# 1. Example\n\n## 1.1 Simple Use\n\n```go\n  \npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\tlogger \"github.com/he-end/simproute/route_logger\"\n\t\"github.com/he-end/simproute/routes\"\n\t\"go.uber.org/zap\"\n)\n\nfunc main() {\n        // register new Routes -\u003e return *Router\n\tr := routes.New()\n\n        // you can set more options\n        //\n        // AutoCorelation bool\n        // RecoverOnPanic bool\n        // by default is 'true', but you can change as 'false'\n        r.AutoCorelation = false\n        r.RecoverOnPanic = false\n\n        // [*] using single route / or simple Route without Prefix Grouping\n  \n        // ==\u003e\u003e GET /api\n        r.Get(\"/api\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(`{\"oke\":true}`))\n\t}) \n        // ==\u003e\u003e GET /api/user1/1\n        r.GET(\"/api/{name_user}/:id\", PostHandler)  \n\n        // [*] using grouping params/path\n  \n  \n        r.Group(\"/api/v2/users\", gr func(*Router){\n                // ==\u003e\u003e GET /api/v2/users\n                gr.Get(\"/\", GetUserHandler)\n                // ==\u003e\u003e PUT /api/v2/users/products/12\n                gr.PUT(\"/products/:id\", PostPaymentHandler)\n        })\n  \n        // we also create logger in the package, as default logger will run as \n        // logger.InitLogger(\"dev\", \"debug\") in the engine,\n        // but you can change the option with \"prod\"/\"production\",\n        // and level as \"debug\", \"info\", \"warn\", \"error\", \"fatal\", \"panic\" for minimal to getting Logs.\n        //\n        // Note the order, InitLogger() is executed simultaneously with Router() registration.\n\tlogger.InitLogger(\"dev\", \"debug\")\n\n        // add the Http Server With Handler or final result *Router{} where you register using New()\n\tnewServ := \u0026http.Server{Addr: \":8080\", Handler: r}\n\tfmt.Println(\"==============================\")\n\tfmt.Println(`server run in : localhost:8080`)\n\tfmt.Println(\"==============================\")\n\tif err := newServ.ListenAndServe(); err != nil || err != http.ErrServerClosed {\n\t\tlogger.Error(\"undefine error\", zap.Error(err))\n\t}\n}\n\n```\n\n# 2. Logger\n\n## 2.1 The Printer logger \"DEV\" Mode\n\nstructure of logger is  `TEXT`+`JSON` format.\n\n### 2.1.1 Logger No Resource Request\n\n```json\n2025-12-19T04:07:30.143+0700\tINFO\troutes/serv_http.go:62\thttp_request\t{\"method\": \"GET\", \"path\": \"/as\", \"status\": 404, \"ip\": \"[::1]:38758\", \"duration\": \"76.879µs\", \"request_id\": \"627a2619-bf20-48f2-a8ad-bba0a4fa86b8\"}\n```\n\n### 2.1.2 Logger Request Success\n\n```json\n2025-12-19T04:08:23.117+0700\tINFO\troutes/serv_http.go:62\thttp_request\t{\"method\": \"GET\", \"path\": \"/api\", \"status\": 200, \"ip\": \"[::1]:58864\", \"duration\": \"122.278µs\", \"request_id\": \"2c900f34-cbbb-49a4-8f29-153f2fb4a0a5\"}\n```\n\n### 2.1.3 Logger Error on Panic Recovered\n\n```json\n2025-12-19T04:13:54.156+0700\tERROR\troutes/serv_http.go:74\tpanic recovered\t{\"error\": \"runtime error: invalid memory address or nil pointer dereference\", \"method\": \"GET\", \"path\": \"/api\", \"request_id\": \"2b00362d-3950-4424-a232-75ef7d3b9c29\", \"request_id\": \"2b00362d-3950-4424-a232-75ef7d3b9c29\"}\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP.func2\n\t/home/hend/development/github/simproute/routes/serv_http.go:74\nruntime.gopanic\n\t/usr/lib/go-1.22/src/runtime/panic.go:770\nruntime.panicmem\n\t/usr/lib/go-1.22/src/runtime/panic.go:261\nruntime.sigpanic\n\t/usr/lib/go-1.22/src/runtime/signal_unix.go:881\nmain.main.func1\n\t/home/hend/development/github/simproute/main.go:16\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/lib/go-1.22/src/net/http/server.go:2171\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP.mwAutoCorelation.func3.1\n\t/home/hend/development/github/simproute/routes/mw.go:22\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/lib/go-1.22/src/net/http/server.go:2171\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP\n\t/home/hend/development/github/simproute/routes/serv_http.go:166\nnet/http.serverHandler.ServeHTTP\n\t/usr/lib/go-1.22/src/net/http/server.go:3142\nnet/http.(*conn).serve\n\t/usr/lib/go-1.22/src/net/http/server.go:2044\n2025-12-19T04:13:54.156+0700\tINFO\troutes/serv_http.go:62\thttp_request\t{\"method\": \"GET\", \"path\": \"/api\", \"status\": 500, \"ip\": \"[::1]:50070\", \"duration\": \"275.525µs\", \"request_id\": \"2b00362d-3950-4424-a232-75ef7d3b9c29\"}\n```\n\n## 2.2 The Printer Logger on 'Prod' Mode\n\nwhen use `prod` envoronment, log will be saved on `logs/` directory. but you still can see the log as `json` literal.\n\n### 2.2.1 Logger Not Found\n\n```json\n{\n  \"level\":\"info\",\"timestamp\":\"2025-12-19T04:20:56.054+0700\",\n  \"caller\":\"routes/serv_http.go:62\",\n  \"msg\":\"http_request\",\n  \"method\":\"GET\",\n  \"path\":\"/apssi\",\n  \"status\":404,\n  \"ip\":\"[::1]:40510\",\n  \"duration\":0.000068929,\n  \"request_id\":\"8fbd60a8-287a-4c39-badd-73895dea3bf7\"\n}\n\n```\n\n### 2.2.2 Logger Error\n\n```json\n{\n  \"level\":\"error\",\n  \"timestamp\":\"2025-12-19T04:22:40.267+0700\",\n  \"caller\":\"routes/serv_http.go:74\",\n  \"msg\":\"panic recovered\",\n  \"error\":\"runtime error: invalid memory address or nil pointer dereference\",\"method\":\"GET\",\"path\":\"/api\",\"request_id\":\"c5576ff2-bfa5-4c18-b2a0-14fa55cfdea8\",\"request_id\":\"c5576ff2-bfa5-4c18-b2a0-14fa55cfdea8\",\"stacktrace\":\"github.com/he-end/simproute/routes.(*Router).ServeHTTP.func2\\n\\t/home/hend/development/github/simproute/routes/serv_http.go:74\\nruntime.gopanic\\n\\t/usr/lib/go-1.22/src/runtime/panic.go:770\\nruntime.panicmem\\n\\t/usr/lib/go-1.22/src/runtime/panic.go:261\\nruntime.sigpanic\\n\\t/usr/lib/go-1.22/src/runtime/signal_unix.go:881\\nmain.main.func1\\n\\t/home/hend/development/github/simproute/main.go:16\\nnet/http.HandlerFunc.ServeHTTP\\n\\t/usr/lib/go-1.22/src/net/http/server.go:2171\\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP.mwAutoCorelation.func3.1\\n\\t/home/hend/development/github/simproute/routes/mw.go:22\\nnet/http.HandlerFunc.ServeHTTP\\n\\t/usr/lib/go-1.22/src/net/http/server.go:2171\\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP.mwAutoCorelation.func3.1\\n\\t/home/hend/development/github/simproute/routes/mw.go:22\\nnet/http.HandlerFunc.ServeHTTP\\n\\t/usr/lib/go-1.22/src/net/http/server.go:2171\\ngithub.com/he-end/simproute/routes.(*Router).ServeHTTP\\n\\t/home/hend/development/github/simproute/routes/serv_http.go:166\\nnet/http.serverHandler.ServeHTTP\\n\\t/usr/lib/go-1.22/src/net/http/server.go:3142\\nnet/http.(*conn).serve\\n\\t/usr/lib/go-1.22/src/net/http/server.go:2044\"\n}\n```\n\n# 3 OPTIONS Method\n\nin the package method OPTIONS is automatic include.\n\nany `path` can `called with Method OPTIONS`, the response code is `201 No Content`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe-end%2Fsimproute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhe-end%2Fsimproute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe-end%2Fsimproute/lists"}