{"id":15056394,"url":"https://github.com/elli-lib/elli","last_synced_at":"2025-05-14T15:11:16.903Z","repository":{"id":11207822,"uuid":"65711895","full_name":"elli-lib/elli","owner":"elli-lib","description":"Simple, robust and performant Erlang web server","archived":false,"fork":false,"pushed_at":"2024-11-15T16:52:50.000Z","size":1419,"stargazers_count":331,"open_issues_count":21,"forks_count":39,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-12T02:57:32.521Z","etag":null,"topics":["api-server","apis","elli","erlang","http","http-server","modular","performance","web","webserver"],"latest_commit_sha":null,"homepage":"https://github.com/elli-lib/elli/blob/develop/doc/README.md","language":"Erlang","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/elli-lib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2016-08-15T07:06:04.000Z","updated_at":"2025-04-08T10:29:09.000Z","dependencies_parsed_at":"2024-06-28T21:48:27.905Z","dependency_job_id":"42e760cd-edaa-461d-a4c5-7348dd239584","html_url":"https://github.com/elli-lib/elli","commit_stats":{"total_commits":469,"total_committers":39,"mean_commits":"12.025641025641026","dds":0.5991471215351812,"last_synced_commit":"c874c42b5d5c1fb7477bc1655134d1de9cbe0223"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elli-lib%2Felli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elli-lib","download_url":"https://codeload.github.com/elli-lib/elli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254153380,"owners_count":22023601,"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":["api-server","apis","elli","erlang","http","http-server","modular","performance","web","webserver"],"created_at":"2024-09-24T21:50:41.494Z","updated_at":"2025-05-14T15:11:16.846Z","avatar_url":"https://github.com/elli-lib.png","language":"Erlang","readme":"# Elli - Erlang web server for HTTP APIs\n\n[![Hex.pm](https://img.shields.io/hexpm/v/elli.svg)](https://hex.pm/packages/elli)\n[![Documentation](https://img.shields.io/badge/docs-edown-green.svg)](https://hexdocs.pm/elli/)\n[![Erlang](https://img.shields.io/badge/erlang-%E2%89%A520.0-red.svg)](http://www.erlang.org/downloads)\n![Common Test](https://github.com/elli-lib/elli/workflows/Common%20Test/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/elli-lib/elli/badge.svg?branch=develop)](https://coveralls.io/github/elli-lib/elli?branch=develop)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nElli is a webserver you can run inside your Erlang application to\nexpose an HTTP API. It is aimed exclusively at building\nhigh-throughput, low-latency HTTP APIs. If robustness and performance\nis more important to you than general purpose features, then Elli might be\nfor you. If you find yourself digging into the implementation of a\nwebserver, then Elli might be for you. If you're building web services,\nnot web sites, then Elli might be for you.\n\nElli requires OTP 22.0 or newer.\n\n## Installation\n\nAdd `elli` to your application as a dependency to your\n[`rebar.config`](https://www.rebar3.org/docs/configuration):\n\n```erlang\n{deps, [\n  {elli, \"3.3.0\"}\n]}.\n```\n\nAfterwards, to compile it, you can run:\n\n```console\nrebar3 compile\n```\n\n## Usage\n\nTo boot Elli inside an Erlang shell, run:\n\n```console\nrebar3 shell\n```\n\n```erlang\n%% starting elli\n1\u003e {ok, Pid} = elli:start_link([{callback, elli_example_callback}, {port, 3000}]).\n```\n\n## Examples\n\n### Callback Module\n\nThe best source to learn how to write a callback module\nis [`elli_example_callback`](elli_example_callback.html).\nThere are also a bunch\nof examples used in the tests as well as descriptions of all the events.\n\nA minimal callback module looks something like this:\n\n```erlang\n-module(elli_minimal_callback).\n-behaviour(elli_handler).\n\n-include_lib(\"elli/include/elli.hrl\").\n\n-export([handle/2, handle_event/3]).\n\nhandle(Req, _Args) -\u003e\n    %% Delegate to our handler function\n    Method = Req#req.method,\n    Path = elli_request:path(Req),\n    handle(Method, Path, Req).\n\nhandle('GET' = _Method, [\u003c\u003c\"hello\"\u003e\u003e, \u003c\u003c\"world\"\u003e\u003e] = _Path, _Req) -\u003e\n    %% Reply with a normal response. `ok' can be used instead of `200'\n    %% to signal success.\n    StatusCode = ok,\n    Headers = [],\n    Body = \u003c\u003c\"Hello World!\"\u003e\u003e,\n    {StatusCode, Headers, Body};\n\nhandle(_Method, _Path, _Req) -\u003e\n    {404, [], \u003c\u003c\"Not Found\"\u003e\u003e}.\n\n%% @doc Handle request events: request completed, exception\n%% thrown, client timeout, etc. Must return `ok'.\nhandle_event(_Event, _Data, _Args) -\u003e\n    ok.\n```\n\n### Supervisor ChildSpec\n\nTo add `elli` to a supervisor you can use the following example and adapt it to\nyour needs.\n\n```erlang\n-module(elli_minimal_sup).\n-behaviour(supervisor).\n\n-export([start_link/0, init/1]).\n\nstart_link() -\u003e\n    SupName = {local, ?MODULE},\n    Module = ?MODULE,\n    Args = [],\n    supervisor:start_link(SupName, Module, Args).\n\ninit([] = _Args) -\u003e\n    ElliOpts = [\n        {callback, elli_minimal_callback},\n        {port, 3000}\n    ],\n    ElliSpec = {\n        _Id = elli_minimal_http,\n        _Start = {elli, start_link, [ElliOpts]},\n        _Restart = permanent,\n        _Shutdown = 5000,\n        _Worker = worker,\n        _Modules = [elli]},\n\n    {ok, {{_Strategy = one_for_one, _Intensity = 5, _Period = 10}, [ElliSpec]} }.\n```\n\n## Further reading\n\nFor more information about the features and design philosophy of Elli check\nout the [`overview`](overview.html).\n\n## License\n\nElli is licensed under [The MIT License](LICENSE).\n","funding_links":[],"categories":["Erlang"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felli-lib%2Felli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felli-lib%2Felli/lists"}