Hey all,
Probably a stupid question.. but I work with various formats that often specify URL paths to other documents.. in my code.. I need to grab (download) and load (parse) those documents from those URL refs.
However.. when I am developing on my local machine.. and working with an empty (new) doc.. the URLs are not actual documents online. Nor do I want to try to push documents to a URL that I then ref.. so that my code can then actually fetch them.
How do you get around this for local development.. where you want to just put some test files on the local dev box, and reference them from the doc's URLs.. but they eventually become published online docs? So every time I go to do some work.. I have to manually change them to local file paths.. but then reset them before I publish/commit the doc (if any changes other than the url paths changed).
Furthermore.. technically a URL doesn't map to a local relative file system using ../path/file without using file:// protocol.
But my code is meant to read those URLs, download them and parse them as part of the project.
Only way I can think of is use some sort of "dev" flag in the app.. that then loads a "url to file" map config file.. so that in dev mode, I load this map of url to files.. then anytime a url matches one of those.. I instead load the file that is mapped to the url. So that way.. I am not changing the URL fields in the doc I am parsing.. but can still work with local files so that I don't have to deal with pushing URL changes out to a site every time I make changes.
Does that seem logical.. or is there a better way to do this sort of thing?
submitted by /u/GoPlugMeIn
[link] [comments]
from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/hNRHMkP