|
4 | 4 |
|
5 | 5 | using namespace drogon; |
6 | 6 |
|
7 | | -class prelight : public drogon::HttpController<prelight> |
8 | | -{ |
9 | | - public: |
10 | | - METHOD_LIST_BEGIN |
11 | | - // use METHOD_ADD to add your custom processing function here; |
12 | | - // METHOD_ADD(prelight::get, "/{2}/{1}", Get); // path is /prelight/{arg2}/{arg1} |
13 | | - // METHOD_ADD(prelight::your_method_name, "/{1}/{2}/list", Get); // path is /prelight/{arg1}/{arg2}/list |
14 | | - // ADD_METHOD_TO(prelight::your_method_name, "/absolute/path/{1}/{2}/list", Get); // path is /absolute/path/{arg1}/{arg2}/list |
| 7 | +class prelight : public drogon::HttpController<prelight> { |
| 8 | +public: |
| 9 | + METHOD_LIST_BEGIN |
| 10 | + ADD_METHOD_TO(prelight::handlePrelight, "/v1/chat/completions", Options); |
| 11 | + ADD_METHOD_TO(prelight::handlePrelight, "/v1/embeddings", Options); |
| 12 | + ADD_METHOD_TO(prelight::handlePrelight, "/v1/audio/transcriptions", Options); |
| 13 | + ADD_METHOD_TO(prelight::handlePrelight, "/v1/audio/translations", Options); |
| 14 | + METHOD_LIST_END |
15 | 15 |
|
16 | | - METHOD_LIST_END |
17 | | - // your declaration of processing function maybe like this: |
18 | | - // void get(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, int p1, std::string p2); |
19 | | - // void your_method_name(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, double p1, int p2) const; |
| 16 | + void handlePrelight(const HttpRequestPtr &req, |
| 17 | + std::function<void(const HttpResponsePtr &)> &&callback); |
20 | 18 | }; |
0 commit comments