ngrest-HelloWorld (c++ API 框架)

2019-03-12 10:09:08 阅读:10 编辑

开发操作系统

  1. Ubuntu 16.04.6 LTS
  2. 虚拟机 vmware 12 ( 桥接模式)

开发环境

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install Git cmake g++
注:Ubuntu 需登出用户

获取源码

cd /root
mkdir .ngrest
cd .ngrest
Git clone https://github.com/loentar/ngrest.git

编译

mkdir -p ngrest-build
cd ngrest-build
cmake -DCMAKE_BUILD_TYPE=DEBUG -DWITH_EXAMPLES=1 ../ngrest
make

创建 HelloWorld

export PATH=$PATH:/root/.ngrest/ngrest/scripts
ngrest create HelloWorld
cd helloworld
ngrest

访问 URL

url:

http://localhost:9098/helloworld/abc

output:
{"result":"Hi, abc"}
注:只有本地访问