Added ngrest project structure and absolutehumidity rest
This commit is contained in:
14
RestServer/humidityserver/src/humidityserver.cpp
Normal file
14
RestServer/humidityserver/src/humidityserver.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
// This file generated by ngrestcg
|
||||
// For more information, please visit: https://github.com/loentar/ngrest
|
||||
|
||||
#include "humidityserver.h"
|
||||
|
||||
/*std::string humidityserver::echo(const std::string& text)
|
||||
{
|
||||
return "Hi, " + text;
|
||||
}*/
|
||||
|
||||
float humidityserver::absolutehumidity(float temperature, float humidity) {
|
||||
|
||||
return temperature + humidity;
|
||||
}
|
25
RestServer/humidityserver/src/humidityserver.h
Normal file
25
RestServer/humidityserver/src/humidityserver.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// This file generated by ngrestcg
|
||||
// For more information, please visit: https://github.com/loentar/ngrest
|
||||
|
||||
#ifndef HUMIDITYSERVER_H
|
||||
#define HUMIDITYSERVER_H
|
||||
|
||||
#include <ngrest/common/Service.h>
|
||||
|
||||
//! Dummy description for the service
|
||||
/*! Some detailed description of the service */
|
||||
// '*location' comment sets resource path for this service
|
||||
// *location: humidityserver
|
||||
class humidityserver: public ngrest::Service
|
||||
{
|
||||
public:
|
||||
// *method: GET
|
||||
// *location: /abshum?temperature={temperature}&humidity={humidity}
|
||||
float absolutehumidity(float temperature, float humidity);
|
||||
};
|
||||
|
||||
|
||||
#endif // HUMIDITYSERVER_H
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user