Cloud function and opensea metadata uri


I’m trying to return useful metadata for platforms such opensea to get the name and image of the nft but I’m not able to do so using cloud functions

this is the uri I have made

you can change number 4 at the end with another token ID
but the problem is the object that’s returned is not clean.

how can I return it as

name: “name”,
description: “desc”,
image: “img”

I guess that way opensea will be able to read my metadata and display it correctly.

I hope someone can help me

btw this is the cloud function I made

Moralis.Cloud.define("getNft", async function handle_request(req) {
  const query = new Moralis.Query("nft");
  query.equalTo("nft_id", parseInt(;
  const results = await query.first();;
  return results;

Hi @ndstart

It’s not possible

You can use moralis static hosting. You can see the example on tutorial