Connection works in mjs, not in edge function
I have a js connection setup to the database that works great for me when testing the script, but when I put it into an edge function it fails. The URL and Key are the same in both cases.
What does the function expect that's different from what you can pass in a .mjs script? I'm a javascript newb so there's probably some fundamental difference I'm not aware of.
The error is in the screenshot along with the connection script from both places (the one with "try" is from the edge function), and pasted here:
"TypeError: error sending request for url (http://127.0.0.1:54321/rest/v1/user_apps?id=eq.2&select=*): client error (Connect): tcp connect error: Connection refused (os error 111): Connection refused (os error 111)\n
at async mainFetch (ext:deno_fetch/26_fetch.js:191:12)\n
at async fetch (ext:deno_fetch/26_fetch.js:465:11)\n
at async postData (file:///var/tmp/sb-compile-edge-runtime/hexnode_app_search/index.ts:33:27)\n
at async Object.handler (file:///var/tmp/sb-compile-edge-runtime/hexnode_app_search/index.ts:74:22)\n
at async mapped (ext:runtime/http.js:231:18)"
What does the function expect that's different from what you can pass in a .mjs script? I'm a javascript newb so there's probably some fundamental difference I'm not aware of.
The error is in the screenshot along with the connection script from both places (the one with "try" is from the edge function), and pasted here:
"TypeError: error sending request for url (http://127.0.0.1:54321/rest/v1/user_apps?id=eq.2&select=*): client error (Connect): tcp connect error: Connection refused (os error 111): Connection refused (os error 111)\n
at async mainFetch (ext:deno_fetch/26_fetch.js:191:12)\n
at async fetch (ext:deno_fetch/26_fetch.js:465:11)\n
at async postData (file:///var/tmp/sb-compile-edge-runtime/hexnode_app_search/index.ts:33:27)\n
at async Object.handler (file:///var/tmp/sb-compile-edge-runtime/hexnode_app_search/index.ts:74:22)\n
at async mapped (ext:runtime/http.js:231:18)"


