{"id":15879964,"url":"https://github.com/crowdhailer/ace","last_synced_at":"2025-05-16T11:06:31.848Z","repository":{"id":35826564,"uuid":"40109433","full_name":"CrowdHailer/Ace","owner":"CrowdHailer","description":"HTTP web server and client, supports http1 and http2","archived":false,"fork":false,"pushed_at":"2021-04-20T03:49:24.000Z","size":705,"stargazers_count":306,"open_issues_count":16,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-16T11:06:24.855Z","etag":null,"topics":["elixir","elixir-lang","erlang","h2spec","http","http2","https","tls","web"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/ace","language":"Elixir","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/CrowdHailer.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}},"created_at":"2015-08-03T06:49:28.000Z","updated_at":"2025-04-23T18:54:15.000Z","dependencies_parsed_at":"2022-09-17T04:42:33.090Z","dependency_job_id":null,"html_url":"https://github.com/CrowdHailer/Ace","commit_stats":null,"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2FAce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2FAce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2FAce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2FAce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrowdHailer","download_url":"https://codeload.github.com/CrowdHailer/Ace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"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":["elixir","elixir-lang","erlang","h2spec","http","http2","https","tls","web"],"created_at":"2024-10-06T03:06:42.706Z","updated_at":"2025-05-16T11:06:26.839Z","avatar_url":"https://github.com/CrowdHailer.png","language":"Elixir","readme":"# Ace\n\n**HTTP web server and client, supports http1 and http2**\n\n[![Hex pm](http://img.shields.io/hexpm/v/ace.svg?style=flat)](https://hex.pm/packages/ace)\n[![Build Status](https://secure.travis-ci.org/CrowdHailer/Ace.svg?branch=master\n\"Build Status\")](https://travis-ci.org/CrowdHailer/Ace)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n- [Install from Hex](https://hex.pm/packages/ace)\n- [Documentation available on hexdoc](https://hexdocs.pm/ace)\n- [Discuss on slack](https://elixir-lang.slack.com/messages/C56H3TBH8/)\n\nSee [Raxx.Kit](https://github.com/CrowdHailer/raxx_kit) for a project generator that helps you set up\na web project based on [Raxx](https://github.com/CrowdHailer/raxx)/[Ace](https://github.com/CrowdHailer/Ace).\n\n## Get started\n\n#### Hello, World!\n```elixir\ndefmodule MyApp do\n  use Ace.HTTP.Service, port: 8080, cleartext: true\n  use Raxx.SimpleServer\n\n  @impl Raxx.SimpleServer\n  def handle_request(%{method: :GET, path: []}, %{greeting: greeting}) do\n    response(:ok)\n    |\u003e set_header(\"content-type\", \"text/plain\")\n    |\u003e set_body(\"#{greeting}, World!\")\n  end\nend\n```\n\n*The arguments given to use Ace.HTTP.Service are default values when starting the service.*\n\n#### Start the service\n\n```elixir\nconfig = %{greeting: \"Hello\"}\n\nMyApp.start_link(config, port: 1234)\n```\n\n*Here the default port value has been overridden at startup*\n\n#### Raxx\n\nAce implements the Raxx HTTP interface.\nThis allows applications to be built with any components from the Raxx ecosystem.\n\nRaxx has tooling for streaming, server-push, routing, api documentation and more. See [documentation](https://hexdocs.pm/raxx/readme.html) for details.\n\n*The correct version of raxx is included with ace, raxx does not need to be added as a dependency.*\n\n#### TLS/SSL\n\nIf a service is started without the `cleartext` it will start using TLS. This requires a certificate and key.\n\n```elixir\nconfig = %{greeting: \"Hello\"}\noptions = [port: 8443, certfile: \"path/to/certificate\", keyfile: \"path/to/key\"]\n\nMyApp.start_link(application, options)\n```\n\n*TLS is required to serve content via HTTP/2.*\n\n#### Supervising services\n\nThe normal way to run services is as part of a projects supervision tree. When starting a new project use the `--sup` flag.\n\n```sh\nmix new my_app --sup\n```\n\nAdd the services to be supervised in the application file `lib/my_app/application.ex`.\n\n```elixir\ndefmodule MyApp.Application do\n  @moduledoc false\n\n  use Application\n\n  def start(_type, _args) do\n    import Supervisor.Spec, warn: false\n\n    children = [\n      {MyApp, [%{greeting: \"Hello\"}]}\n    ]\n\n    opts = [strategy: :one_for_one, name: MyApp.Supervisor]\n    Supervisor.start_link(children, opts)\n  end\nend\n```\n\nStart project using `iex -S mix` and visit [http://localhost:8080](http://localhost:8080).\n\n## Testing\n\n```\nmix test --include ci:true\n```\n\nWill run [h2spec](https://github.com/summerwind/h2spec) as one of the tests.\n\nIf the `h2spec` is not specified in the environment variable `$H2SPEC_PATH` or on the\n`$PATH`, it will be downloaded into `test/support/h2spec/` and executed.\n\n## Alternative HTTP servers\n\nOther servers you can use for Elixir/erlang applications are [Cowboy](https://github.com/ninenines/cowboy) and [Elli](https://github.com/elli-lib/elli).\n\nOf the three Cowboy is the most widely used.\nBoth Elli and Cowboy are written in erlang, Ace is written in Elixir.\n\n[Elixir HTTP Benchmark - Ace vs Cowboy](http://www.devstopfix.com/posts/2019/elixir-http-benchmark/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdhailer%2Face","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdhailer%2Face","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdhailer%2Face/lists"}