dutchcoders / slackarchive

Archiver for Slack Teams
301 stars 27 forks source link

App makes localhost ajax requests when hosted remotely #9

Closed paulwilton closed 6 years ago

paulwilton commented 6 years ago

Have all deployed on a remote host (ec2) Load the app in browser, but it makes an ajax request to http://127.0.0.1:8080/v1/team is this remote API endpoint configurable ?

nl5887 commented 6 years ago

It should be adapting the address it is loading from, see https://github.com/dutchcoders/slackarchive-app/blob/master/src/services.js#L3.

paulwilton commented 6 years ago

Thanks for the swift reply ! when I debug in the chrome dev console, the line in the code is:

const apiUrl = window.location.protocol + '//' + '127.0.0.1:8080' + '/v1/';

it looks hardcoded in the version of the app in the docker image

screen shot 2018-05-05 at 22 14 37
nl5887 commented 6 years ago

Hmm, thats weird. Everything seems to be set ok, could you test with pulling the latest? docker-compose pull?

paulwilton commented 6 years ago

yes that is the latest - I think you need to release a new version of the slackarchive app docker image

nl5887 commented 6 years ago

Alright, rebuilded the frontend and pushed the code. The new docker image should be there in a few. You can monitor progress here: https://hub.docker.com/r/dutchcoders/slackarchive/builds/

paulwilton commented 6 years ago

Yes thats fixed it It is working perfectly now - the bot is collecting messages - all good appreciate this Remco - it's a super bit of work you guys have done

for ref, I have deployed this on a single t2.medium Ubuntu 16.04 EC2 instance

nl5887 commented 6 years ago

That's great. I'll close this issue, but will update the docs with all new lessons learned. Thanks for all the testing and bug hunting!