Initial Release

This commit is contained in:
Tola Leng
2025-05-09 21:28:07 +07:00
commit 0c6cd18e6f
244 changed files with 50633 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
// API routes handler
import realtime from './realtime';
/**
* Simple API router for client-side application
*/
const api = {
/**
* Handle API requests
*/
async handleRequest(path, method, body) {
console.log(`API request: ${method} ${path}`, body);
// Route to the appropriate handler
if (path === '/api/realtime') {
console.log("Routing to realtime handler");
return await realtime(body);
}
// Return 404 for unknown routes
console.error(`Endpoint not found: ${path}`);
return {
status: 404,
json: {
ok: false,
error_code: 404,
description: "Endpoint not found"
}
};
}
};
export default api;