{"id":21130830,"url":"https://github.com/ngn13/ctorm","last_synced_at":"2025-04-13T09:02:01.498Z","repository":{"id":225639599,"uuid":"766480537","full_name":"ngn13/ctorm","owner":"ngn13","description":"Simple web framework for C","archived":false,"fork":false,"pushed_at":"2025-01-15T17:51:53.000Z","size":278,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T00:33:59.554Z","etag":null,"topics":["c-web","c-web-framework","c-webserver-program","simple-web-server","web-framework"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngn13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-03-03T11:43:04.000Z","updated_at":"2025-01-16T03:24:05.000Z","dependencies_parsed_at":"2024-06-19T05:39:08.623Z","dependency_job_id":"e2912e52-1ce8-4a0c-9ead-2bb268a47f25","html_url":"https://github.com/ngn13/ctorm","commit_stats":null,"previous_names":["ngn13/ctorm"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngn13%2Fctorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngn13%2Fctorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngn13%2Fctorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngn13%2Fctorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngn13","download_url":"https://codeload.github.com/ngn13/ctorm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688575,"owners_count":21145765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c-web","c-web-framework","c-webserver-program","simple-web-server","web-framework"],"created_at":"2024-11-20T05:39:48.212Z","updated_at":"2025-04-13T09:02:01.470Z","avatar_url":"https://github.com/ngn13.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n        __\n  _____/ /_____  _________ ___\n / ___/ __/ __ \\/ ___/ __ `__ \\\n/ /__/ /_/ /_/ / /  / / / / / /\n\\___/\\__/\\____/_/  /_/ /_/ /_/ 1.7\n\n```\n\n# ctorm | simple web framework for C\n![](https://img.shields.io/github/actions/workflow/status/ngn13/ctorm/docker.yml)\n![](https://img.shields.io/github/actions/workflow/status/ngn13/ctorm/docker.yml?label=tests)\n![](https://img.shields.io/github/v/tag/ngn13/ctorm?label=version)\n![](https://img.shields.io/github/license/ngn13/ctorm)\n\nctorm is a multi-threaded, simple web server framework for `HTTP/1.1` and `HTTP/1.0`.\nIt has an easy API for general web server applications.\n\n\u003e [!WARNING]\n\u003e This software is pretty much in alpha state. I don't suggest you use ctorm on\n\u003e production, however it can be used to build simple web applications just for fun.\n\nI do plan to continue the development of this project, so please consider contributing\nif you are interested.\n\n### Features\n- Wildcard routes\n- Middleware support\n- URL queries (parameters)\n- URL encoded body parsing\n- JSON support with [cJSON](https://github.com/DaveGamble/cJSON)\n- Handling 404 (all) routes\n- Sending files and static file serving\n\n### Installation\nYou will need the following software in order to build and install ctorm:\n- GNU tar to extract the release archive (`tar`)\n- GCC and other general build tools (`build-essential`)\n- If you want to build the man pages, [`doxygen`](https://www.doxygen.org/)\n- If you want JSON support, cJSON and it's headers (`cjson`, `libcjson-dev`)\n\nFirst [download the latest release archive](https://github.com/ngn13/ctorm/tags),\n**do not compile from the latest commit or a branch unless you are doing development**:\n```bash\nwget https://github.com/ngn13/ctorm/archive/refs/tags/1.5.tar.gz\ntar xf 1.5.tar.gz \u0026\u0026 cd ctorm-1.5\n```\nThen use the `make` command to compile the library:\n```bash\nmake\n```\n**If you don't have cJSON installed**, you need to run this command with `CTORM_JSON_SUPPORT=0`\noption to disable JSON support:\n```bash\nmake CTORM_JSON_SUPPORT=0\n```\n**If you installed `doxygen`, and you want to build the man pages** run `make` with\nthe `docs` command:\n```bash\nmake docs\n```\nTo install the library (and if you've built it, the documentation) run `make` with\nthe `install` command **as root**:\n```bash\nmake install\n```\n\n### Getting started\n#### Hello world application\n```c\n#include \u003cctorm/ctorm.h\u003e\n\nvoid GET_index(ctorm_req_t *req, ctorm_res_t *res) {\n  // send the \"Hello world!\" message\n  RES_SEND(\"Hello world!\");\n}\n\nint main() {\n  // create the app with default configuration\n  ctorm_app_t *app = ctorm_app_new(NULL);\n\n  // setup the routes\n  GET(app, \"/\", GET_index);\n\n  // run the app\n  if (!ctorm_app_run(app, \"0.0.0.0:8080\"))\n    ctorm_fail(\"failed to start the application: %s\", ctorm_geterror());\n\n  // clean up\n  ctorm_app_free(app);\n  return 0;\n}\n```\n\n#### Other functions\nHere are some nicely formatted markdown documents that explain all the functions you will\nmost likely gonna use:\n- [App](docs/app.md)\n- [Error](docs/error.md)\n- [Logging](docs/log.md)\n- [Request](docs/req.md)\n- [Response](docs/res.md)\n\nYou can also checkout the man pages if you built and installed during the [installation](#installation).\n\n#### Example applications\nRepository also contains few example applications in the `example` directory. You can\nbuild these by running:\n```bash\nmake example\n```\n\n#### Deploying your application\nYou can use the docker image (built by github actions) to easily deploy your\napplication, here is an example:\n```Dockerfile\nFROM ghcr.io/ngn13/ctorm:latest\n\nWORKDIR /app\n\n# copy over all the sources\nCOPY main.c    ./\nCOPY Makefile  ./\n\n# run the make script\nRUN make\n\n# set the startup command\nCMD [\"/app/server\"]\n```\n\n### Development\nFor development, you can compile the library with the `CTORM_DEBUG=1` option to enable debug\nmessages:\n```bash\nmake CTORM_DEBUG=1\n```\nThen you can use the example applications and the test scripts in the `scripts` directory\nfor testing:\n```bash\nmake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngn13%2Fctorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngn13%2Fctorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngn13%2Fctorm/lists"}