aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2019-11-30 08:17:35 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2019-12-01 05:23:11 +0300
commit0d8be2903c20fe09f8bece9a8b26054e7cb96440 (patch)
tree17b0d4a36d9c017527bbb5513c0beaa0f14ce6ec
parentadd Docker files (diff)
downloadmath-server-0d8be2903c20fe09f8bece9a8b26054e7cb96440.tar.gz
math-server-0d8be2903c20fe09f8bece9a8b26054e7cb96440.zip
add README.md
-rw-r--r--README.md77
1 files changed, 77 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..49f99a9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,77 @@
+math-server
+===========
+
+Development
+-----------
+
+Build using CMake.
+Depends on Boost.{Asio,Filesystem,Program_options,Test}.
+
+Usage
+-----
+
+### `server`
+
+If you just run `server`, it'll start a server on port 18000.
+You can `telnet` to it, type in arithmetic expressions, and it'll give you the
+results:
+
+ 1
+ 1
+ 2 * 2
+ 4
+ 1 / (3 - -3)
+ 0.16666666666666666
+ 1 / (-3 - -3)
+ server error: parser error: division by zero
+
+Consult `server --help` for more info.
+
+### `client`
+
+A `telnet`-like client for the server.
+It'll try to connect to the server on localhost:18000.
+
+Supports reading input from:
+
+* the command line,
+
+ > client -c "2 * 2"
+ 4
+
+* a file(s),
+
+ > client test.txt
+ result1
+ result2
+
+* stdin.
+
+ > client
+ 1
+ 1
+ 2 * 2
+ 4
+ 1 / (3 - -3)
+ 0.16666666666666666
+ 1 / (-3 - -3)
+ server error: parser error: division by zero
+
+Consult `client --help` for more info.
+
+### Docker
+
+Start the server using
+
+ docker-compose pull && docker-compose up -d server
+
+Connect to localhost:18000 to query it or run the client:
+
+ > docker-compose run --rm client -c "69 * 420"
+ 28980
+
+ > docker-compose run --rm client
+ 12 * 12
+ 144
+ asdf
+ server error: lexer error: invalid input at: asdf