{"id":38478150,"url":"https://github.com/vixcpp/core","last_synced_at":"2026-03-10T20:01:55.014Z","repository":{"id":317896540,"uuid":"1069185622","full_name":"vixcpp/core","owner":"vixcpp","description":"vixcpp/core – The core of the vix.cpp framework. Provides the HTTP server, router, JSON utilities, and middleware system. All other modules are built on top of it.","archived":false,"fork":false,"pushed_at":"2026-03-08T12:00:25.000Z","size":2007,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-08T14:57:26.049Z","etag":null,"topics":["backend","core","cpp","fast","http","runtime","vix","vix-core","vix-framework","vix-runtime","vixcpp"],"latest_commit_sha":null,"homepage":"https://vixcpp.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vixcpp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-10-03T14:32:18.000Z","updated_at":"2026-03-08T11:59:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"6fa4da57-3dea-42e9-890a-b29d9e66026d","html_url":"https://github.com/vixcpp/core","commit_stats":null,"previous_names":["vixcpp/core"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/vixcpp/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vixcpp","download_url":"https://codeload.github.com/vixcpp/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30351725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"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":["backend","core","cpp","fast","http","runtime","vix","vix-core","vix-framework","vix-runtime","vixcpp"],"created_at":"2026-01-17T05:24:19.978Z","updated_at":"2026-03-10T20:01:54.970Z","avatar_url":"https://github.com/vixcpp.png","language":"C++","readme":"# Vix Core\n\nFast HTTP runtime • Router • Request/Response • JSON helpers • Production-ready primitives\n\n`core` is the foundation of **Vix.cpp**.\nIt provides the HTTP runtime primitives used across the ecosystem:\n\n* `vix::App` — the main HTTP application\n* routing (`get/post/...`) with path params\n* `Request` / `Response` wrappers\n* JSON helpers (`vix::json`) for fast structured responses\n* query params, headers, body access\n* predictable status codes + early return patterns\n\nIf Vix.cpp is a runtime, **core is its execution engine for HTTP**.\n\n---\n\n## Quick start\n\nRun the showcase example:\n\n```bash\nvix run examples/vix_routes_showcase.cpp\n```\n\nThen hit a few endpoints:\n\n```bash\ncurl -i http://127.0.0.1:8080/\ncurl -i http://127.0.0.1:8080/health\ncurl -i http://127.0.0.1:8080/users/42\ncurl -i \"http://127.0.0.1:8080/search?q=vix\u0026page=2\u0026limit=5\"\ncurl -i http://127.0.0.1:8080/headers\ncurl -i http://127.0.0.1:8080/status/404\n```\n\n---\n\n## Minimal HTTP server\n\n```cpp\n#include \u003cvix.hpp\u003e\n\nusing namespace vix;\n\nint main()\n{\n  App app;\n\n  app.get(\"/\", [](Request\u0026, Response\u0026 res) {\n    res.json({\"message\", \"Hello, Vix!\"});\n  });\n\n  app.run(8080);\n}\n```\n\n---\n\n## Routing model\n\nVix routes are designed to be:\n\n* **simple** to read\n* **copy/paste friendly** for real projects\n* explicit about status codes and early returns\n\n### Basic routes\n\n```cpp\napp.get(\"/hello\", [](const Request\u0026, Response\u0026) {\n  return vix::json::o(\"message\", \"Hello\", \"id\", 20);\n});\n\napp.get(\"/txt\", [](const Request\u0026, Response\u0026) {\n  return \"Hello world\";\n});\n```\n\n### Status codes\n\n```cpp\napp.get(\"/status/{code}\", [](Request\u0026 req, Response\u0026 res) {\n  const int code = /* parse */ 200;\n  res.status(code).json({\n    \"status\", code,\n    \"ok\", (code \u003e= 200 \u0026\u0026 code \u003c 300)\n  });\n});\n```\n\n### Path params\n\n```cpp\napp.get(\"/users/{id}\", [](Request\u0026 req, Response\u0026 res) {\n  const std::string id = req.param(\"id\", \"0\");\n\n  if (id == \"0\") {\n    res.status(404).json({\"error\", \"User not found\", \"id\", id});\n    return;\n  }\n\n  res.json({\"id\", id, \"vip\", (id == \"42\")});\n});\n```\n\n### Query params\n\n```cpp\napp.get(\"/search\", [](Request\u0026 req, Response\u0026 res) {\n  const std::string q = req.query_value(\"q\", \"\");\n  const std::string page = req.query_value(\"page\", \"1\");\n  const std::string limit = req.query_value(\"limit\", \"10\");\n\n  res.json({\n    \"q\", q,\n    \"page\", page,\n    \"limit\", limit\n  });\n});\n```\n\n### Headers\n\n```cpp\napp.get(\"/headers\", [](Request\u0026 req, Response\u0026 res) {\n  res.json({\n    \"host\", req.header(\"Host\"),\n    \"user_agent\", req.header(\"User-Agent\"),\n    \"accept\", req.header(\"Accept\")\n  });\n});\n```\n\n---\n\n## Request body + JSON parsing\n\nCore exposes the raw body and JSON parsing helpers.\n\n```cpp\napp.get(\"/echo/body\", [](Request\u0026 req, Response\u0026 res) {\n  const std::string body = req.body();\n  res.json({\"bytes\", (long long)body.size(), \"body\", body});\n});\n\napp.get(\"/echo/json\", [](Request\u0026 req, Response\u0026 res) {\n  const auto\u0026 j = req.json();\n  res.json(j);\n});\n```\n\nFor defensive field access, the showcase demonstrates patterns like:\n\n* check `is_object()`\n* check `contains()` + type\n* return defaults on missing fields\n\n---\n\n## Mixed behaviors (send + return)\n\nVix supports both:\n\n* explicit response (`res.send`, `res.json`)\n* return-value auto-send (string or JSON object)\n\nIf you **already sent** a response explicitly, the returned value is ignored.\n\n```cpp\napp.get(\"/mix\", [](Request\u0026, Response\u0026 res) {\n  res.status(201).send(\"Created\");\n  return vix::json::o(\"ignored\", true);\n});\n```\n\nThis makes it easy to write handlers in a style similar to Node/FastAPI:\n\n* short happy path\n* early return on errors\n\n---\n\n## Showcase example\n\nThe recommended living reference for the public API style is:\n\n* `examples/vix_routes_showcase.cpp`\n\nIt includes:\n\n* simple routes\n* JSON responses (flat + nested)\n* status codes\n* path params (`/users/{id}`)\n* query params (`?page=1\u0026limit=20`)\n* headers\n* request body + JSON parsing\n* mixed behaviors (send + return)\n* many copy/paste route patterns\n\n---\n\n## How core fits in the umbrella\n\n* `core` powers the HTTP runtime (`vix::App`, routing, request/response)\n* `middleware` attaches on top of core (security, parsers, auth, cache)\n* `websocket` can run standalone or alongside HTTP\n* `p2p_http` uses core to expose P2P control endpoints\n\n---\n\n## Directory layout\n\nTypical layout:\n\n```\nmodules/core/\n│\n├─ include/vix/\n│  ├─ http/...\n│  ├─ router/...\n│  ├─ server/...\n│  ├─ session/...\n│  ├─ config/...\n│  ├─ utils/...\n│  └─ vix.hpp            # umbrella include for HTTP runtime\n│\n└─ examples/\n   └─ vix_routes_showcase.cpp\n```\n\n---\n\n## License\n\nMIT — same as Vix.cpp\n\nRepository: [https://github.com/vixcpp/vix](https://github.com/vixcpp/vix)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvixcpp%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fcore/lists"}