This is a 5 minutes tutorial how-to-use Oat++ (AKA oatpp) web framework to build your ownC++ performant web-service and integrate it with Swagger-UI.
Clone oatpp repo:
$ git clone https://github.com/oatpp/oatpp
$ cd oatpp/
On Mac/Linux:
$ mkdir build && cd build/
$ cmake ..
$ make install
For more detailed instructions see - installing Oat++ on Unix/Linux.
On Windows:
$ MD build
$ cd build/
$ cmake ..
$ cmake --build . --target INSTALL
For more detailed instructions see - installing Oat++ on Windows.
Now we are able to build services using Oat++. It is a zero-dependency framework, so NO additional installations are required.
Clone “oatpp-starter”
$ git clone --depth=1 https://github.com/oatpp/oatpp-starter my-service
$ cd my-service/
Build “oatpp-starter” on Mac/Linux
$ mkdir build && cd build/
$ cmake ..
$ make
Build “oatpp-starter” on Windows
$ MD build
$ cd build/
$ cmake ..
$ cmake --build .
Run compiled executable:
$ ./my-project-exe
$ .\src\Debug\my-project-exe.exe
Now go to localhost:8000_ and m_ake sure that you can see the response from server
{"statusCode": 200, "message": "Hello World!"}
#web-development #swagger #api #cplusplus #developer