Logging changes, and the pathname for local versus deployed #10913
JimNayzium
started this conversation in
General
Replies: 1 comment
-
Hey, I’m not too sure myself but maybe you can try the below for getting a consistent path in node: process.cwd() |
Beta Was this translation helpful? Give feedback.
0 replies
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 am successfully writing a log.txt file with all the information I need on my local npm run dev version using this:
My question is after I do a full build and upload to my hosted environment, will this path hold true? It feels like /src won't be in the final build path?
What is the best way to go about coding this type of solution that would work locally and after deployment?
I tried using local path names (i.e. like ../../path_here) but it would not work in the dev environment that way for some reason.
I come from a PHP background and a novice one at that, so I am used to using $_SERVER['DOCUMENT_ROOT'] whenever I need to do something similarly.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions