Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to set the working directory to enable relative requires #131

Open
holyjak opened this issue Jun 10, 2016 · 4 comments
Open

Comments

@holyjak
Copy link

holyjak commented Jun 10, 2016

I would like to be able to start Mancy from my Node project directory and be able to require files in it (require("./my-project-file.js");). It could either pick up the directory when starting or accept a setting / command line option to set the working directory.

That way, it would be much easier to experiment with an existing project.

(Currently my workaround is to do const root= "/absolute/path/to/project/dir/"; require(root + "my-project-file.js"))

Thank you!

@holyjak
Copy link
Author

holyjak commented Jun 21, 2016

I would be willing to help implement it if you could point me in the right direction (where to look / add it)

@princejwesley
Copy link
Owner

@jakubholynet I'll check and let you know. I forgot the reason why I set this

@holyjak
Copy link
Author

holyjak commented Jun 21, 2016

Thanks!

Good messages in commits / comments FTW :)
tir. 21. jun. 2016 kl. 16.48 skrev Prince John Wesley <
notifications@github.com>:

@jakubholynet https://github.com/jakubholynet I'll check and let you
know. I forgot the reason why I set this
https://github.com/princejwesley/Mancy/blob/master/src/main/index.js#L83


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#131 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAmJPiyKgGhUQy3pPyyPVRha0IxzQbz8ks5qN_mfgaJpZM4IzC5Z
.

@princejwesley
Copy link
Owner

Try this fix 😄 Its a hack to make it work. While loading relative path, parent module file is set as index.html. Let me see whether there exists a better fix for this problem.

Unfortunately This particular fix is tricky, Its not easy to show direction. Very sorry!!!

princejwesley added a commit that referenced this issue Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants