this is my fetch function
async function getData() {
const userCookies = cookies()
const url = process.env.INTERNAL_BACK_URL ??"http://127.0.0.1:8000/"
const res = await fetch(url+"user/info/",
{headers: { Cookie : userCookies },})
if (!res.ok) {
throw new Error('Failed to fetch data')
}
return res.json()
}
and for url i used this 2 pattern but both get errors
pergamer_back.railway.internal/user/info
[cause]: TypeError [ERR_INVALID_URL]: Invalid URL
and
http://pergamer_back.railway.internal/
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: Error: connect ECONNREFUSED fd12:ae40:cb28::cf:ac56:6757:80
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: 'fd12:ae40:cb28::cf:ac56:6757',
port: 80