[SOLVED] Sudden Internal Server Error 500 Web3 API

Hi,
I have not made any changes to my code, but all of a sudden I am getting a 500 server error when I hit any of my web3 API routes. I am wondering if there are currently problems on the Moralis server? My code previously worked perfectly. Now I am always getting a 500 status error.

router.post('/nft/search', async (req, res) => {
  try {
    await Moralis.start({ serverUrl, appId })
    const options = { q: req.body.q, filter: 'name', limit: 20 }
    let NFTSres = await Moralis.Web3API.token.searchNFTs(options)
    res.json({ NFTS: NFTSres })
  } catch (err) {
    res.status(500).json({ error: err })
  }
})

What is the server url?

In particular you can use web3api from nodejs without a server too, by using moralisSecret for Moralis.start

1 Like

I used my moralisSecret and got it working. I think it must’ve been an issue with my dev environment and not Moralis. Thanks!

2 Likes

https://docs.moralis.io/moralis-dapp/connect-the-sdk/connect-using-node

the the docs on how to getting started with node.js

Designed by me :slight_smile:

great job I used these when setting up my project and they were super easy to follow and worked perfectly

1 Like