demo-node / index.js
randydev's picture
Update index.js
37ffed7 verified
raw
history blame
474 Bytes
import express from 'express';
import { randomBytes } from "crypto";
const app = express();
const startServer = async (app) => {
const port = 7860
app.listen(port, "0.0.0.0", () => {
console.log(`Server running on http://localhost:${port}`);
console.log(randomBytes(32).toString('hex'))
});
};
app.post('/webhook', (req, res) => {
console.log('Received webhook:', req.body);
res.status(200).send('Webhook received');
});
startServer();