Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 850 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 850 Bytes

kv server and forwarder

This is an implementation of a key value store with an HTTP interface. There's also a "forwarding" implementation that proxies requests to an upstream server implementing the same interface.

build

To build with stack do stack build.

To run with stack do stack exec kv-server.

run

Set the port with environment variables.

Provide the address of an upstream server to start a forwarder.

USAGE:
  env PORT=<PORT> kv-server # start a receiver
  env PORT=<PORT> kv-server <RECEIVER-ADDR> # start a forwarder

example

./example.sh demonstrates starting up a chain of three servers (one receiver and two forwarders). It then demonstrates making several calls to the servers to show that they work. Finally, it waits for the user to press enter or ctl+c before shutting down those servers.