Parse API connection error

The endpoint is initialised above it, but this is an endpoint from moralis as well

you mean that you hardcoded a speedy node url as that endPoint?

yes, indeed. Is that something that you shouldn’t do?

that is fine, it looks like you don’t use Moralis SDK in that code, in this case you don’t even need to init it

Oh yeah ofcourse, but like for other codes that I need it doesn’t work like for example:

const express = require("express");
const Moralis = require('moralis/node');
var Web3 = require('web3');


const app = express();

const { MANAGER } = require("./config/smartcontracts.config");
const { managerABI } = require("./abis/manager");
// Initizalise
async function initMoralis(){
    const start = await Moralis.start({ serverUrl: "https://rmatpmaksrdg.usemoralis.com:2053/server", appId: "dPGQ7D2JsTCoKnL98tLnLxWwewVjrJHSWD5AfeVi" }).catch((err) => { console.log(err) });
    console.log(Moralis.CoreManager.get("VERSION"))
}

initMoralis()

async function getAllTokenIds(){
	const tokens = await Moralis.Web3API.token.getAllTokenIds({ address: "0x8bac6324c21b3db9d385a9172cea41ff36669f41", chain: "rinkeby", }).catch((err) => { /*console.log(err)*/ });
	
	if(tokens){
	    return tokens
	} else {
	    return null
	}
}

// Repeat get all items every x minutes
setInterval(getAllTokenIds, 1000); // 60.000 is 1 minute.

  

// Start server
app.listen(4000, async() => {
 	console.log("API has been started on port 4000!");
})

add some logging to understand what happens there

use await for that initMoralis

try to write a simpler script that only calls a function