{"id":16645499,"url":"https://github.com/ers35/modserver","last_synced_at":"2025-03-21T16:30:40.143Z","repository":{"id":43144227,"uuid":"64003947","full_name":"ers35/modserver","owner":"ers35","description":"modserver is an HTTP/1.1 application server.","archived":false,"fork":false,"pushed_at":"2018-01-29T04:42:51.000Z","size":498,"stargazers_count":44,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T02:51:35.337Z","etag":null,"topics":["lua"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ers35.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}},"created_at":"2016-07-23T07:05:30.000Z","updated_at":"2025-02-20T10:12:15.000Z","dependencies_parsed_at":"2022-09-22T06:51:30.181Z","dependency_job_id":null,"html_url":"https://github.com/ers35/modserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ers35%2Fmodserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ers35%2Fmodserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ers35%2Fmodserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ers35%2Fmodserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ers35","download_url":"https://codeload.github.com/ers35/modserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244829366,"owners_count":20517295,"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":["lua"],"created_at":"2024-10-12T08:24:02.707Z","updated_at":"2025-03-21T16:30:39.736Z","avatar_url":"https://github.com/ers35.png","language":"C","readme":"`modserver` is an HTTP/1.1 application server. Applications are loaded at runtime from a \nconfiguration file. The server exports an API for use by applications to interpret \nrequests and generate responses. Modules provide support for loading applications written \nin a variety of programming languages.\n\nHere is an example application that writes a message to the user using the C API:\n```\n#include \"modserver.h\"\n\nint run(servlet *s)\n{\n  rprintf(s, \"hello from C\");\n  return 0;\n}\n```\n\n## Building\n`modserver` builds on at least the following platforms: DragonFly BSD, FreeBSD, \nGNU/Linux, illumos, Mac OS X, NetBSD, and OpenBSD. Run `make` or `gmake` depending on the \nplatform.\n\nIndividual modules may fail to build if their dependencies are not found. This is normal \nand does not affect the building of the server. Read the [Makefile](src/Makefile) to get \na sense for what is required to build each module.\n\n## Dependencies\n- A C compiler supporting C99.\n- An operating system supporting POSIX.1-2001.\n- [Lua](https://www.lua.org/)\n- [luaposix](https://github.com/luaposix/luaposix)\n- [luastatic](https://github.com/ers35/luastatic)\n- [LPeg](http://www.inf.puc-rio.br/~roberto/lpeg/)\n\nA copy of all build dependencies are included in source form in the [dep](src/dep/) \ndirectory. Modules may require additional dependencies.\n\n## Usage\n`modserver config.conf`\n\n## Configuration\nSee [config.conf](src/config.conf) for an example configuration file and \n[config.lua](src/config.lua) for the available configuration options.\n\nThe server listens on port 8080 by default: http://127.0.0.1:8080/\n\n## API\nThe C API is documented in [modserver.h](src/api/c/modserver.h).\n\nSee the [api](src/api/) directory for bindings for other languages.\n\n## Languages\nThere are example hello world applications in a variety of programming languages:\n- [C](src/example/c/hello.c)\n- [C++](src/example/c++/hello.cpp)\n- [Crystal](src/example/crystal/hello.cr)\n- [CGI](src/example/cgi/hello.cgi)\n- [D](src/example/d/hello.d)\n- [Go](src/example/go/hello.go)\n- [Haskell](src/example/haskell/hello.hs)\n- [Lua](src/example/lua/hello.lua)\n- [Nim](src/example/nim/hello.nim)\n- [Python](src/example/python/hello.py)\n- [Ruby](src/example/ruby/hello.rb)\n- [Rust](src/example/rust/hello.rs)\n- [Scheme](src/example/scheme/hello.scm)\n\nSee the [module](src/module/) directory to learn how to add support for another \nlanguage.\n\n## Design\nThe design is a traditional forking server. Each concurrent request is handled by a \nseparate process. A new process is created when all processes are busy handling a \nrequest. A process handles many requests to avoid the overhead of forking on each \nrequest. An idle process exits after five seconds to free its resources.\n\nApplications are free to use blocking I/O because the operating system schedules the \nprocesses. A crash while handling a request does not affect other requests. The server \nreports the crash and continues running. One tradeoff with this design is the memory \nusage increases with the number of concurrent requests as more processes are created.\n\n## Feedback\nEmail [eric@ers35.com](mailto:eric@ers35.com) or post a GitHub issue to give feedback.\n\n## Known Issues\n- Go servlets panic on Mac OS X.\n- Go servlets sometimes deadlock on runtime.futexsleep.\n- Ruby servlets sometimes crash.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fers35%2Fmodserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fers35%2Fmodserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fers35%2Fmodserver/lists"}