Unable to host on ports different from 3000 #13408
Unanswered
realJogicodes
asked this question in
Q&A
Replies: 2 comments 1 reply
|
That is not how According to the docs, you can just set the variables for the PORT=3001 pm2 ...The |
0 replies
|
thanks. Initially, I had the variable in front like you said, same outcome but I never had it on built too. Will try that tomorrow and report back |
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.
I am struggling to host my svelte kit application on ports other than 3000. I do not know what I am doing wrong either. Maybe you guys have an idea. I run more than one application on this machine, hence the need for a different port, 3001 maybe. Anyway, I use pm2 so I thought
pm2 start index.js --name app-2 --env PORT=3001would do the trick. It did not.
The next idea was to change `vite.config.ts
When I build it like this, I do get
const port = env('PORT', !path && '3000');in mybuild/index.jsfile, surprisingly.The only way I can pull this off is if I go into that file and modify it to
const port = env('PORT', !path && '3001');after building and then run pm2, that works, but that's not practical because every time I make a change to the application I am going to have to manually do this, and that's no good.All reactions