File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,18 @@ int main(int argc, const char** argv) {
72
72
resp.set_content (FixText (corrector, req.get_param_value (" text" )), " text/plain" );
73
73
});
74
74
75
+ srv.Post (" /fix" , [&corrector](const httplib::Request& req, httplib::Response& resp) {
76
+ resp.set_content (FixText (corrector, req.body ), " text/plain" );
77
+ });
78
+
75
79
srv.Get (" /candidates" , [&corrector](const httplib::Request& req, httplib::Response& resp) {
76
80
resp.set_content (GetCandidates (corrector, req.get_param_value (" text" )), " text/plain" );
77
81
});
78
82
83
+ srv.Post (" /candidates" , [&corrector](const httplib::Request& req, httplib::Response& resp) {
84
+ resp.set_content (GetCandidates (corrector, req.body ), " text/plain" );
85
+ });
86
+
79
87
std::cerr << " [info] starting web server at localhost:" << port << std::endl;
80
88
srv.listen (" localhost" , port);
81
89
return 0 ;
You can’t perform that action at this time.
0 commit comments