diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-24 14:59:39 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-25 08:11:26 -0700 |
| commit | 301de3ac5c7cf8a5eaaf3c58157251db781841d6 (patch) | |
| tree | d0a19062d01de0df130a59613134330809b2a5ae /demo/rest/README.adoc | |
| parent | b36dadf267842fb2fad7596f90f8f0cd78ac4af5 (diff) | |
| download | nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.gz nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.bz2 nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.zip | |
fixes #486 Revisit SOVERSION and VERSION
fixes #485 Honor BUILD_SHARED_LIBS
fixes #483 Don't expose private symbols in shared library
fixes #481 Export CMake target
This is a "large" commit involving changes that don't affect the
code directly, but which have an impact on how we package and build
our project.
The most significant of these changes is that we now build only
either a shared or a static library, depending on the setting of
the BUILD_SHARED_LIBS option. We also suppress private symbols
from being exposed when the underlying toolchain lets us do so.
Minor updates to the way we version the ABI are used, and we now
have a nice exported CMake project.
To import this project in another, simply do find_package(nng)
and you can add target_link_libraries(nng::nng) to your targets.
CMake does the rest for you.
Diffstat (limited to 'demo/rest/README.adoc')
| -rw-r--r-- | demo/rest/README.adoc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/demo/rest/README.adoc b/demo/rest/README.adoc index 6a363329..df3e30b0 100644 --- a/demo/rest/README.adoc +++ b/demo/rest/README.adoc @@ -3,7 +3,7 @@ This is a somewhat contrived demonstration, but may be useful in a pattern for solving real world problems. -There is a single "server" program, that does these: +There is a single "server" (rest-server) program, that does these: . REST API at /api/rest/rot13 - this API takes data from HTTP POST commands, and forwards them to an NNG REQ socket. When the REQ response comes, @@ -17,9 +17,29 @@ There is a single "server" program, that does these: [source, bash] ---- % env PORT=8888 # default -% ./server & +% ./rest-server & % curl -d ABC http://127.0.0.1:8888/api/rest/rot13; echo NOP % curl -d ABC http://127.0.0.1:8888/api/rest/rot13; echo ABC ---- + +== Compiling + +To build the program, we recommend CMake and Ninja-Build. + +[source, bash] +---- +% mkdir build +% cd build +% cmake -G Ninja .. +% ninja +---- + +Alternatively, you can go old-school. +Here's the simplest option for Linux: + +[source, bash] +---- +% cc server.c -o rest-server -I /usr/local/include -lnng +---- |
