Problem accessing local deployment

default discord avatar
ricor
3 months ago
3

I run payload on a dedicated server (says with IP address IP_A). Then , I want to access it from my laptop.



An error happens for me when I point to



http://IP_A:3000/admin

on my laptop



In the devconsole, the call to API/users/me API endpoint fails and hangs. I tried to add a cord: '*' in the config but it did not work.



I cannot access it without doing a port forwarding. Is there another way to expose the port IP_A:3000 to any one?

  • discord user avatar
    alessiogr
    Payload Team
    3 months ago

    Hey hey! Did you add the correct IP+Port to the

    serverURL

    field in your

    payload.config.ts

    ?


    And, could you share the exact error you're getting?

  • default discord avatar
    ricor
    3 months ago

    I fixed it by removing the field

    serverUrl

    actually. I found an old issue reporting this on GH. Apparently, the

    create-payload-app

    script creates a wrong configuration.



    The error I am get is on the fetch request

    api/users/me

    . It fails to return a response while it should returns a null user.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.