I just launched my self hosted server on AWS and this is how I start the server and Moralis.
However, when I tried to put the webhook in the Moralis Admin, it’s not receiving on my server.
When I tried it on Postman, my webhook works properly.
const server = new ParseServer({
.....
});
app.post('/webhook', async (req, res) => {
const { body, headers } = req;
try {
Moralis.Streams.verifySignature({
body,
signature: headers["x-signature"],
});
return res.status(200).json();
} catch (e) {
console.log("Not Moralis");
return res.status(400).json();
}
});
const startServer = async () => {
server.start().then(async () => {
await Moralis.start({
apiKey: 'MORALISKEY',
});
});
app.listen(1337, function () {
console.log('parse-server-example running on port 1337.');
});
};
startServer();