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
raoulyoung2 years ago
6

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

  • default discord avatar
    notchr2 years ago
    @1117749311757881464

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

  • default discord avatar
    raoulyoung2 years ago

    Sure thingy, just a sec



    so im stuck with the name instead of id



    And good morning 🙂

  • default discord avatar
    notchr2 years ago

    Hmm



    Does the image display?



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

  • default discord avatar
    raoulyoung2 years ago

    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
    notchr2 years ago

    can i checkout your payload.config.js



    seems like a misconfigured server url

  • default discord avatar
    raoulyoung2 years ago

    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.