Skip to content

Example project how-to use oatpp-consul integration module.

License

Notifications You must be signed in to change notification settings

oatpp/example-consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consul Integration Example Build Status

Example project how-to use oatpp-consul module.

See more:

Overview

This project is using oatpp and oatpp-consul modules.

Currently this is trivial example.- Read/Write from/to Consul KV via endpoints declared in Controller. More complex example later.

In this example Consul is expected to run at port 8500.

Project layout

|- CMakeLists.txt                        // projects CMakeLists.txt
|- src/
|    |
|    |- controller/                      // Folder containing controller where all endpoints are declared
|    |- dto/                             // DTOs are declared here
|    |- AppComponent.hpp                 // Service config
|    |- App.cpp                          // main() is here
|
|- test/                                 // test folder
|- utility/install-oatpp-modules.sh      // utility script to install required oatpp-modules.

Build and Run

Using CMake

Requires

  • oatpp and oatpp-consul modules installed. You may run utility/install-oatpp-modules.sh script to install required oatpp modules.
$ mkdir build && cd build
$ cmake ..
$ make 
$ ./example-consul-exe          # - run application.

In Docker

$ docker build -t example-consul .
$ docker run -p 8000:8000 -t example-consul