Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

image upload static url

default discord avatar
raoulyounglast year
6

Hi, any idea why my node.value.url comes out as "api/collection/media/name" and not with id.

  • default discord avatar
    notchrlast year
    @1117749311757881464

    Good morning! Could you please post an example of the code in question?

  • default discord avatar
    raoulyounglast year

    Sure thingy, just a sec



    so im stuck with the name instead of id



    And good morning 🙂

  • default discord avatar
    notchrlast year

    Hmm



    Does the image display?



    Also, where do you get node.value.url from

  • default discord avatar
    raoulyounglast year

    nopw



    but if i correctly replace the name with id it the api address works fine



    {"id":"64ad3547943f936396cedacf","alt":"ux","filename":"hash.png","mimeType":"image/png","filesize":5036,"width":56,"height":56,"createdAt":"2023-07-11T10:56:07.152Z","updatedAt":"2023-07-11T10:56:07.152Z","url":"cms-api/media/hash.png"}

    return value from my media collection

  • default discord avatar
    notchrlast year

    can i checkout your payload.config.js



    seems like a misconfigured server url

  • default discord avatar
    raoulyounglast year

    ahh



    routes: {


    api: "/cms-api",


    admin: "/cms-admin",


    },



    changed my staticURL: "cms-admin and found my content

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.