diff --git a/server/src/server.ts b/server/src/server.ts index 2179f946..9620d9f1 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -15,6 +15,9 @@ import { SERVER_PORT } from "./constants/config"; import { Server } from "socket.io"; import { readdirSync } from "fs" import { fork } from 'child_process'; +import captureServerAnalytics from "./utils/analytics"; +import swaggerUi from 'swagger-ui-express'; +import swaggerSpec from './swagger/config'; const app = express(); app.use(cors({ @@ -47,6 +50,7 @@ app.use('/storage', storage); app.use('/auth', auth); app.use('/integration', integration); app.use('/proxy', proxy); +app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); readdirSync(path.join(__dirname, 'api')).forEach((r) => { const route = require(path.join(__dirname, 'api', r)); @@ -73,6 +77,10 @@ workerProcess.on('exit', (code) => { }); app.get('/', function (req, res) { + captureServerAnalytics.capture({ + distinctId: 'maxun-oss-server-run', + event: 'server_started', + }); return res.send('Maxun server started 🚀'); });