test ws
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { FastifyPluginAsync } from 'fastify';
|
||||
import { checkUpdate, login, showDashboard, update, resetQueue, getCurrentUser, cleanupManually, restartCoolify, refreshTemplates } from './handlers';
|
||||
import { GetCurrentUser } from './types';
|
||||
import pump from 'pump'
|
||||
import fs from 'fs'
|
||||
import { asyncExecShell, encrypt, errorHandler, prisma } from '../../../lib/common';
|
||||
|
||||
export interface Update {
|
||||
Body: { latestVersion: string }
|
||||
|
||||
@@ -70,7 +70,7 @@ const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
||||
fastify.get<OnlyId>('/:id/usage', async (request) => await getServiceUsage(request));
|
||||
fastify.get<GetServiceLogs>('/:id/logs/:containerId', async (request) => await getServiceLogs(request));
|
||||
|
||||
fastify.post<ServiceStartStop>('/:id/start', async (request) => await startService(request));
|
||||
fastify.post<ServiceStartStop>('/:id/start', async (request) => await startService(request, fastify));
|
||||
fastify.post<ServiceStartStop>('/:id/stop', async (request) => await stopService(request));
|
||||
fastify.post<ServiceStartStop & SetWordpressSettings & SetGlitchTipSettings>('/:id/:type/settings', async (request, reply) => await setSettingsService(request, reply));
|
||||
|
||||
|
||||
7
apps/api/src/routes/realtime/index.ts
Normal file
7
apps/api/src/routes/realtime/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function realtime(fastify, connection, message) {
|
||||
const { socket } = connection
|
||||
const data = JSON.parse(message);
|
||||
if (data.type === 'subscribe') {
|
||||
socket.send(JSON.stringify({ type: 'subscribe', message: 'pong' }))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user