silverwolf-x's picture
download
raw
535 Bytes
import Ably from "ably/promises";
import type { NextApiRequest, NextApiResponse } from "next/types";
import type { TextMessage } from "../../types";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const client = new Ably.Realtime(process.env.ABLY_API_KEY);
const channel = client.channels.get("some-channel-name");
const message: TextMessage = {
text: `Server sent a message on behalf of ${req.body.sender}`,
};
channel.publish("test-message", message);
res.status(200);
}

Xet Storage Details

Size:
535 Bytes
·
Xet hash:
9275a3643f653c8d65a8865c76cbf9a142fc7f7ad89a147279214536dbd1b1ce

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.