crdt-server/index.js

14 lines
292 B
JavaScript
Raw Normal View History

2023-03-30 01:22:00 +00:00
import { Server } from "@hocuspocus/server";
2023-03-29 15:17:43 +00:00
2023-03-30 01:22:00 +00:00
const server = Server.configure({
async onAuthenticate(data) {
const { token } = data;
if (token !== "hocuspocus-token") {
throw new Error("Not authorized!");
}
2023-03-30 00:30:43 +00:00
},
2023-03-29 15:17:43 +00:00
port: 4242,
});
server.listen();