Miruro-no-kuon / Miruro

Stream anime for free on our sleek, minimalistic platform. Powered by ⚡ Vite & 🍞 Bun!
https://www.miruro.tv/
Other
652 stars 173 forks source link

Fix hardcoded `PORT` configurable via .env var. #193

Closed techroy23 closed 7 months ago

techroy23 commented 7 months ago

the port "5173" is currently hardcoded in file https://github.com/Miruro-no-kuon/Miruro/blob/main/vite.config.ts and https://github.com/Miruro-no-kuon/Miruro/blob/main/server/server.ts it would be better if this can be moved to .env.

user70853572305239875909542835673652937 commented 7 months ago

Got it! Just pushed the fix on the preview-main branch – the port's now in the .env file as VITE_PORT. Check out this commit:6a74ca0.

Regarding the server.ts file, I ran into some issues due to a bug or perhaps a weird syntax/configuration issue with Vite that prevents a similar approach for the time being. I'll be looking for possible solutions and will update the thread once I have a fix.

Cheers!

techroy23 commented 7 months ago

i will create a PR for preview branch later.

techroy23 commented 7 months ago

See #196.

techroy23 commented 7 months ago

Findings:

when bun changes directory to server. It cannot see the .env file anymore resulting to undefined value. which can be be debug by including a quick console log :-P

console.log(`Server running on port ${port}`);

user70853572305239875909542835673652937 commented 7 months ago

Awesome work on the port issue! I wondered why it didn't work, and it turned out to be a bun issue after all... Oh and really cool to have you as our first outside contributor. 😊 Thanks for jumping in and making this change—it's a big improvement.

I'm sorry for the delay in my response; I've been pretty busy the past couple of weeks.

Cheers!