chore: add server name while server initialization (#5656)
This commit is contained in:
parent
50af7c5bf6
commit
e143e0a051
2 changed files with 6 additions and 1 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"pino-http": "^10.3.0",
|
"pino-http": "^10.3.0",
|
||||||
"pino-pretty": "^11.2.2",
|
"pino-pretty": "^11.2.2",
|
||||||
|
"uuid": "^10.0.0",
|
||||||
"y-prosemirror": "^1.2.9",
|
"y-prosemirror": "^1.2.9",
|
||||||
"y-protocols": "^1.0.6",
|
"y-protocols": "^1.0.6",
|
||||||
"yjs": "^13.6.14"
|
"yjs": "^13.6.14"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
import { Server } from "@hocuspocus/server";
|
import { Server } from "@hocuspocus/server";
|
||||||
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
// lib
|
||||||
import { handleAuthentication } from "@/core/lib/authentication.js";
|
import { handleAuthentication } from "@/core/lib/authentication.js";
|
||||||
|
// extensions
|
||||||
import { getExtensions } from "@/core/extensions/index.js";
|
import { getExtensions } from "@/core/extensions/index.js";
|
||||||
|
|
||||||
export const getHocusPocusServer = async () => {
|
export const getHocusPocusServer = async () => {
|
||||||
const extensions = await getExtensions();
|
const extensions = await getExtensions();
|
||||||
|
const serverName = process.env.HOSTNAME || uuidv4();
|
||||||
return Server.configure({
|
return Server.configure({
|
||||||
|
name: serverName,
|
||||||
onAuthenticate: async ({
|
onAuthenticate: async ({
|
||||||
requestHeaders,
|
requestHeaders,
|
||||||
requestParameters,
|
requestParameters,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue