Closed tejashah88 closed 7 years ago
use a module for this. Do not write custom code to deal with pathing, separators, etc.
This can go in the next release, no rush.
I realize this is used for cosmetic display purposes only, so I think we can live without tests for it. I still believe these urls should be combined with something like https://www.npmjs.com/package/url-join.
I fixed the places where we combine paths with +
in #72.
I was actually going to change the intent of the PR. Right now, we have a bunch of repetitive code, specifically with loading the modules and other files, and I was thinking that it'd make more sense to make a small utils file that contains any/all helper functions. I'll update the PR in a couple of hours.
If you don't mind looking/merging https://github.com/alexa-js/alexa-app-server/pull/72 first before it becomes a big conflict ...
First, we should make a hard rule not to take this kind of stuff without tests. If it helps, you can add a
root
property and test the output.Secondly, manipulating paths this way is potentially error prone -
path.normalize
seems to be designed exactly for this purpose, so why not use it?