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

support fully qualified paths for use with scripts like pm2 #66

Open
mikedevita opened this issue Feb 8, 2017 · 1 comment
Open

support fully qualified paths for use with scripts like pm2 #66

mikedevita opened this issue Feb 8, 2017 · 1 comment

Comments

@mikedevita
Copy link

mikedevita commented Feb 8, 2017

I use this for an internal imgur type mirror for our enterprise and it works great, however typically we use pm2 to manage the start/stop of nodejs scripts.

something like pm2 start --name img.domain.com /opt/conf/www/img.domain.com/server/server.js is what we try to achieve however i noticed that relative/local paths for the configs are being used, specifically noticed this at server/server.js:220. I changed this to be something like.

main(path.resolve('./','server/', 'server.conf'))

and i use full paths from root for the server.conf for the i and client directories yet i get file not found when i try to refresh a page after uploading an image.

Is there something else im missing to get this to work without cd'ing into server/ and running node server.js &

@mikedevita
Copy link
Author

mikedevita commented Feb 8, 2017

to temporarily work around this i have created a dead simple shell script called server.sh with execute perms in /opt/conf/www/img.domain/com/server.sh

#!/bin/bash
cd /opt/conf/www/img.domain.com/server;
node server.js

i then run it via pm2

pm2 start --name img.domain.com /opt/conf/www/img.domain.com/server.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant