-
Let's say my code architecture is How can i serve my static files depending of the domain used (localhost/127.0.0.1) |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
What I understood is this?app.use(express.static(path.join(__dirname, 'public'))); |
Beta Was this translation helpful? Give feedback.
-
Not what i asked. How can i do that |
Beta Was this translation helpful? Give feedback.
-
127.0.0.1/ and localhost is the same do you want to do 2 server express and share static files? |
Beta Was this translation helpful? Give feedback.
-
separate the files in different folders since they would be different servers example: and if you want to have something in common you can use paths to use some files like |
Beta Was this translation helpful? Give feedback.
-
I want to do that in a single Server. This is the point of my issue. |
Beta Was this translation helpful? Give feedback.
-
Yes you can do that Try this codes;
|
Beta Was this translation helpful? Give feedback.
Yes you can do that
Try this codes;