Node: move webhook receiver
This commit is contained in:
parent
acd7d0dd9f
commit
5b7fc25035
@ -7,11 +7,6 @@ const SERVER_PORT = process.env.SERVER_PORT || 6080;
|
||||
const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY || "devkey";
|
||||
const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET || "secret";
|
||||
|
||||
const webhookReceiver = new WebhookReceiver(
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
@ -35,6 +30,11 @@ app.post("/token", async (req, res) => {
|
||||
res.json(token);
|
||||
});
|
||||
|
||||
const webhookReceiver = new WebhookReceiver(
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
|
||||
app.post("/webhook", async (req, res) => {
|
||||
try {
|
||||
const event = await webhookReceiver.receive(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user