chore: add server name while server initialization (#5656)

This commit is contained in:
Aaryan Khandelwal
2024-09-23 16:44:50 +05:30
committed by GitHub
parent 50af7c5bf6
commit e143e0a051
2 changed files with 6 additions and 1 deletions

View File

@@ -35,6 +35,7 @@
"morgan": "^1.10.0",
"pino-http": "^10.3.0",
"pino-pretty": "^11.2.2",
"uuid": "^10.0.0",
"y-prosemirror": "^1.2.9",
"y-protocols": "^1.0.6",
"yjs": "^13.6.14"

View File

@@ -1,11 +1,15 @@
import { Server } from "@hocuspocus/server";
import { v4 as uuidv4 } from "uuid";
// lib
import { handleAuthentication } from "@/core/lib/authentication.js";
// extensions
import { getExtensions } from "@/core/extensions/index.js";
export const getHocusPocusServer = async () => {
const extensions = await getExtensions();
const serverName = process.env.HOSTNAME || uuidv4();
return Server.configure({
name: serverName,
onAuthenticate: async ({
requestHeaders,
requestParameters,