14 lines
292 B
JavaScript
14 lines
292 B
JavaScript
import { Server } from "@hocuspocus/server";
|
|
|
|
const server = Server.configure({
|
|
async onAuthenticate(data) {
|
|
const { token } = data;
|
|
|
|
if (token !== "hocuspocus-token") {
|
|
throw new Error("Not authorized!");
|
|
}
|
|
},
|
|
port: 4242,
|
|
});
|
|
|
|
server.listen(); |