Iām trying to use Moralis Stream API and downloaded āparse-server-migrationā from your github,
server is running well but the problem is a webhook url doesnāt work.
in moralis stream admin console, this message keeps showing.
Something went wrong!
Could not POST to https://------/streams. Please check your webhook URL.
at the same time, this error message appears on the running server,
error while inserting logs Cannot read properties of undefined (reading āappIdā)
I tried again with the new webhook url created by ngrok plugin.
There was no error in the create stream process. but I sent the coin to the registered address from my wallet, but the transaction data was not registered in the connected mongoDB.
I run the parse server in local and cloud environment both and failed.
here is my code of āindex.tsā
import Moralis from 'moralis';
import express from 'express';
import cors from 'cors';
import { parseDashboard } from './parseDashboard';
import { parseServer } from './parseServer';
import { errorHandler } from './middlewares/errorHandler';
import config from './config';
import { apiRouter } from './apiRouter';
import { streamsSync } from '@moralisweb3/parse-server';
// @ts-ignore
import ParseServer from 'parse-server';
import http from "http";
const app = express();
Moralis.start({
apiKey: config.MORALIS_API_KEY,
});
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(cors());
app.use(
streamsSync(parseServer, {
apiKey: config.MORALIS_API_KEY,
webhookUrl: config.STREAMS_WEBHOOK_URL,
}),
);
app.use(`/${config.SERVER_ENDPOINT}`, parseServer);
app.use('/dashboard', parseDashboard);
app.use('/api', apiRouter);
app.use(errorHandler);
app.use(express.static('public'));
const httpServer = http.createServer(app);
app.listen(config.PORT, () => {
// eslint-disable-next-line no-console
console.log(`${config.APP_NAME} is running on port ${config.PORT}`);
});
ParseServer.createLiveQueryServer(httpServer);
parseDashboard.ts
// @ts-ignore
import ParseDashboard from 'parse-dashboard';
import config from './config';
export const parseDashboard = new ParseDashboard(
{
apps: [
{
appId: config.APPLICATION_ID,
masterKey: config.MASTER_KEY,
serverURL: config.SERVER_URL,
appName: config.APP_NAME,
},
],
trustProxy: 1,
},
{
allowInsecureHTTP: config.ALLOW_INSECURE_HTTP,
}
);