feat: Add game activity status (Experimental)
All checks were successful
Queue Release Build / prepare (push) Successful in 21s
Deploy Web Apps / deploy (push) Successful in 5m14s
Queue Release Build / build-windows (push) Successful in 16m18s
Queue Release Build / build-linux (push) Successful in 29m20s
Queue Release Build / finalize (push) Successful in 36s
All checks were successful
Queue Release Build / prepare (push) Successful in 21s
Deploy Web Apps / deploy (push) Successful in 5m14s
Queue Release Build / build-windows (push) Successful in 16m18s
Queue Release Build / build-linux (push) Successful in 29m20s
Queue Release Build / finalize (push) Successful in 36s
This commit is contained in:
17
server/src/routes/games.ts
Normal file
17
server/src/routes/games.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Router } from 'express';
|
||||
import { matchRunningGames } from '../services/game-matching.service';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.post('/match', async (req, res) => {
|
||||
try {
|
||||
const result = await matchRunningGames(req.body?.processes, req.body?.userId ?? req.ip);
|
||||
|
||||
res.json(result);
|
||||
} catch (error) {
|
||||
console.error('[Games] Failed to match running games', error);
|
||||
res.status(500).json({ error: 'Failed to match running games' });
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -2,6 +2,7 @@ import { Express } from 'express';
|
||||
import healthRouter from './health';
|
||||
import klipyRouter from './klipy';
|
||||
import linkMetadataRouter from './link-metadata';
|
||||
import gamesRouter from './games';
|
||||
import proxyRouter from './proxy';
|
||||
import usersRouter from './users';
|
||||
import serversRouter from './servers';
|
||||
@@ -12,6 +13,7 @@ export function registerRoutes(app: Express): void {
|
||||
app.use('/api', healthRouter);
|
||||
app.use('/api', klipyRouter);
|
||||
app.use('/api', linkMetadataRouter);
|
||||
app.use('/api/games', gamesRouter);
|
||||
app.use('/api', proxyRouter);
|
||||
app.use('/api/users', usersRouter);
|
||||
app.use('/api/servers', serversRouter);
|
||||
|
||||
Reference in New Issue
Block a user