Skip to content
/ httpx Public

A tiny concurrent & fault-tolerant HTTP server that uses pattern matching for routing

Notifications You must be signed in to change notification settings

joshnuss/httpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPX

A tiny concurrent and fault-tolerant HTTP server.

Usage

Create an app file:

# in myapp.exs
defmodule MyApp do
  # handle the / path
  def call(%{path: "/"}),
    do: %{code: 200, type: "text/plain", body: "OMG Y'ALL!!"}

  # everything else is a 404 response
  def call(_),
    do: %{code: 404, body: "say what now?"}
end

Then, start the server

./httpx examples/myapp.exs --port 3000 &
curl localhost:3000

License: MIT

About

A tiny concurrent & fault-tolerant HTTP server that uses pattern matching for routing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages