1- #pragma once
1+ #pragma clang diagnostic push
2+ #pragma clang diagnostic ignored "-Wunused-parameter"
23
34#include " Server.hpp"
45#include " Request.hpp"
@@ -12,14 +13,13 @@ namespace opserver {
1213namespace jsi = facebook::jsi;
1314namespace react = facebook::react;
1415
15- Server::Server (jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker) {
16-
16+ Server::Server (jsi::Runtime &rt, const std::shared_ptr<react::CallInvoker>& invoker) {
1717 function_map[" callback" ] = HFN2 (this , invoker) {
1818 const std::string method = args[0 ].asString (rt).utf8 (rt);
1919 const std::string path = args[1 ].asString (rt).utf8 (rt);
2020 auto callback = std::make_shared<jsi::Value>(rt, args[2 ]);
2121
22- auto handleRequest = [this , &rt, invoker,
22+ auto handleRequest = [invoker,
2323 callback](const httplib::Request &req,
2424 httplib::Response &res) {
2525 auto responseDone = std::make_shared<std::promise<void >>();
@@ -148,15 +148,8 @@ jsi::Value Server::get(jsi::Runtime &rt, const jsi::PropNameID &propNameID) {
148148 return {rt, function_map[name]};
149149}
150150
151- void Server::set (jsi::Runtime &_rt, const jsi::PropNameID &name,
152- const jsi::Value &value) {
153- throw std::runtime_error (" You cannot write to this object!" );
154- }
155-
156151void Server::stop () { server.stop (); }
157152
158- Server::~Server () {
159-
160- };
161-
162153} // namespace opserver
154+
155+ #pragma clang diagnostic pop
0 commit comments