-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
23 lines (18 loc) · 840 Bytes
/
Copy pathmain.cpp
File metadata and controls
23 lines (18 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "RestApiServer.h"
int main() {
RestApiServer server;
if (!server.start(8080)) {
std::cerr << "Failed to start server" << std::endl;
return 1;
}
std::cout << "REST API Server running on http://localhost:8080" << std::endl;
std::cout << "Available endpoints:" << std::endl;
std::cout << " GET /api/data - Get all data" << std::endl;
std::cout << " GET /api/data/{key} - Get specific item" << std::endl;
std::cout << " POST /api/data - Create new data (JSON body)" << std::endl;
std::cout << " PUT /api/data/{key} - Update item (JSON: {\"value\": \"...\"})" << std::endl;
std::cout << " DELETE /api/data/{key} - Delete item" << std::endl;
std::cout << "Press Ctrl+C to stop..." << std::endl;
server.run();
return 0;
}