yagu0 / vchess

Chess variants website: https://vchess.club
ISC License
19 stars 8 forks source link

Use path.sep instead of hardcoded path separators in module path replacements #13

Closed smartchessguiapp closed 4 years ago

smartchessguiapp commented 4 years ago

Hard coding "/" path separator in module path replacements won't work under Windows ( not even under cygwin ).

This pull request replaces hard coded path separators in module path replacements with path.sep. Plus fixes a typo in server ReadMe.

https://nodejs.org/api/path.html#path_path_sep

yagu0 commented 4 years ago

I changed the __dirname lines in /routes/messages to relative paths, and use now $path.sep as you suggest in /utils/db (for some reason relative paths fail here...)

Is it better now, or should I use $path.sep for all require()'s ?!