-
Notifications
You must be signed in to change notification settings - Fork 93
Standalone HTTP server
It's possible to run your services with executable without using ngrestserver or web server module.
Here is the working example on how to create standalone server.
Unpack and build from shadow directory:
unzip calc-standalone.zip
mkdir calc-standalone-build
cd calc-standalone-build
cmake ../calc-standalone
make
Start the standalone server:
deploy/bin/calc
Your service must be available by this URL: http://localhost:8080/calc/echo?text=test
To add new services you must create additional .h
and .cpp
files witin calc/src
dir. Every .h
file which provides a service must be added into CALC_HEADERS
variable in CMakeLists.txt
.
The standalone server is depends on few ngrest libraries, so if you plan to deploy it to the other host, you must copy dependencies from ~/.ngrest/ngrest-build/deploy/lib/
such as: libngrestutils.so libngrestcommon.so libngrestengine.so libngrestjson.so
.