aboutsummaryrefslogtreecommitdiff
path: root/api/umosapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/umosapi.h')
-rw-r--r--api/umosapi.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/api/umosapi.h b/api/umosapi.h
new file mode 100644
index 0000000..684f9d5
--- /dev/null
+++ b/api/umosapi.h
@@ -0,0 +1,33 @@
+#ifndef UmosapiService_H_
+#define UmosapiService_H_
+
+#include <pistache/http.h>
+#include <pistache/description.h>
+#include <pistache/endpoint.h>
+
+#include <pistache/serializer/rapidjson.h>
+
+using namespace Pistache;
+
+class UmosapiService {
+ public:
+
+ UmosapiService(Address addr);
+ virtual ~UmosapiService() {};
+
+ void init(size_t thr);
+
+ void start(std::string swaggerui);
+
+ private:
+ void createDescription();
+
+ void retrieveAll(const Rest::Request& request, Http::ResponseWriter response);
+
+ void addUObject(const Rest::Request& request, Http::ResponseWriter response);
+
+ std::shared_ptr<Http::Endpoint> httpEndpoint;
+ Rest::Description desc;
+ Rest::Router router;
+};
+#endif