Skip to content

Build ngrest from source code

Dmitry edited this page Oct 20, 2020 · 2 revisions

How to build ngrest from source code without using ngrest installer.

Install dependencies

First make sure you have git, CMake and GCC installed. If you unsure just start this:

sudo apt install git cmake g++

This command is for Debian/Ubuntu APT packet manager and may differ for other distributions OS.

Clone source code

mkdir -p ~/install
cd ~/install
https://github.com/loentar/ngrest.git

Build

mkdir -p ~/ngrest-build
cd ~/ngrest-build
cmake ../ngrest -DCMAKE_INSTALL_PREFIX=/opt/ngrest -DCMAKE_BUILD_TYPE=DEBUG -DWITH_EXAMPLES=1 -DWITH_TESTS=1
make 

-DCMAKE_INSTALL_PREFIX=/opt/ngrest specifies the installation directory.

To build debug version use -DCMAKE_BUILD_TYPE=DEBUG.

The -DWITH_EXAMPLES=1 and -DWITH_TESTS=1 arguments enable examples and tests respectively.

Run tests

make test

Install

make install

Start ngrest server

cd /opt/ngrest/bin
./ngrestserver

Now you can try it from web browser: http://localhost:9098/ngrest/services .