aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/pages
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-04-26 15:31:33 +0530
committerLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-04-26 15:31:33 +0530
commit8c9677ffc5aef95964b42c03690eb5ea1b912b13 (patch)
tree8d1941b0e591e601288387c464db098e66e9b365 /app/src/pages
downloadrealtimeloc-8c9677ffc5aef95964b42c03690eb5ea1b912b13.tar.gz
realtimeloc-8c9677ffc5aef95964b42c03690eb5ea1b912b13.tar.bz2
realtimeloc-8c9677ffc5aef95964b42c03690eb5ea1b912b13.zip
testing location tracker
Diffstat (limited to 'app/src/pages')
-rw-r--r--app/src/pages/api/socket.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/src/pages/api/socket.ts b/app/src/pages/api/socket.ts
new file mode 100644
index 0000000..d03b157
--- /dev/null
+++ b/app/src/pages/api/socket.ts
@@ -0,0 +1,20 @@
+import { NextApiRequest } from 'next';
+import { initSocketIO, NextApiResponseWithSocket } from '@/lib/socket';
+
+export default function handler(
+ req: NextApiRequest,
+ res: NextApiResponseWithSocket
+) {
+ // Initialize Socket.IO server
+ initSocketIO(res);
+
+ // Return a success response
+ res.status(200).json({ success: true, message: 'Socket.IO server initialized' });
+}
+
+// Disable Next.js body parsing for WebSockets
+export const config = {
+ api: {
+ bodyParser: false,
+ },
+}; \ No newline at end of file