relative path nodejs
Hello!
i have a trouble with relative paths
I've tried using express, but it doesn't meet my needs (
I also entered __dirname +... but in the hosting itself, it meant /app/music/...
here is my structure:
I looked for solutions, but I didn't find the right one. I would be very grateful if someone would help me or refer to an existing answer
47 Replies
Project ID:
393bf30a-2bf5-46b1-8b01-daf56f0ef6ed
393bf30a-2bf5-46b1-8b01-daf56f0ef6ed
does node 16 even support importing JSON like that?
it appeared to be some linux or railway bug because in my repository this folder has different name, but here it is lowercase
your error shows the import path as all lowercase, what should the filename be called
LoliThumb
like in github repository in latest commit
sus name
the import path involves string interpolation, so print the
album
variable on the line before the import statement, see if that is also lowercaseit is "lolithumb"
loli
i don't know how fs read this
I didn't say anything about fs read
local it works great
that doesn't necessarily mean it's a railway specific issue
try this please?
i've tested it
it returns with small characters because fs said that this folder have only small characters
why is the LoliThumb folder written correctly on my computer, on the github repository, and probably also correctly on the server, but fs on the server searches for it with small letters, although there are a lot of similar folders with large and small letters?
good question
Maybe it's stupid, but I'm surprised
I shall do some testing
..are you hosting free music?
no
i'm creating some kind of portfolio
this is copyright free music?
i don't know
maybe yes
you cant distribute music that isnt copyright free
why
please remove this functionally from your app
but what about a folders?
sorry but im not gonna help you with an issue that also involves breaking railway's tos
i dont say this to be rude, i just dont want your account to get banned
i don't have any copyright's for these art
then you cant host it
but with copyrights i can?
if you have the copyright or permission to host the music/artwork, then yes, but you dont and that means you are in clear violation of tos
it's another matter
thank you
thank you for understanding, please remove that content from your app
done
much appreciated, i really dont mean to come off as rude, but it would be unfortunate to wake up to a banned account one day
sorry for ruffling nerves and wasting your time. I really appreciate that you are helping me and even helped me avoid being banned (although I did not even suspect that I would ever encounter this) and thank you!
i will do some testing on this filename stuff, but computer is acting up real good right now
files keep their casing in my testing
https://test-service2.up.railway.app/
can you show me the code of searching files in relative path?
or it is railway's tool
there was no code involved
i used
https://github.com/vercel/serve
wow it's useful
the code
the output
so this is an issue in your code somewhere
okay thanks
that is definitely not how you use that