Replies: 1 comment 1 reply
-
You don't have to prefix the build command with origin. It's the node build/index.js command. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using
@sveltejs/adapter-node
on DigitalOcean Apps and managed to get it up and running as long as I setcheckOrigin
to false, which I understand is not ideal. I've seen a few posts about setting theORIGIN
environment variable but it doesn't seem to work.On DigitalOcean Apps, my component settings are as follows:
npm run build
npm run preview
The Apps interface allows you to set environment variables, but the posts I've seen online mention prefixing
npm run build
withORIGIN=http://localhost:3000
(such asORIGIN=http://localhost:3000 npm run build
). I'm not sure if these two methods are identical. Meanwhile, the adapter-node docs mentionORIGIN=https://my.site node build
. To add to the confusion, the port is 4173 in my setup, but both the docs and the posts I've seen speak of port 3000 (if I'm not mistaken, this is the default port used by Node, while Vite'spreview
uses 4173).I've tried every combination based on the previous information:
ORIGIN
environment variable (in the Apps interface) ashttp://localhost:3000
,http://localhost:4173
andhttps://my.site
ORIGIN=http://localhost:3000
,ORIGIN=http://localhost:4173
andORIGIN=https://my.site
None of these work. I'm starting to wonder if DigitalOcean's deployment process is overriding something, or if my configuration is faulty in some other way. There's also a set of "CORS Policy" settings in the Apps interface, but I don't think they are relevant (I've left them as "Not Configured"). In my browser network tab, the origin header is always
https://my.site
no matter what setup I use. It also may be worth noting that I'm currently testing using theondigitalocean.app
domain provided by DigitalOcean. Any help?Beta Was this translation helpful? Give feedback.
All reactions