I created this using public repo but repeatedly am...
# ask-questions
j
I created this using public repo but repeatedly am getting this error, Should I missed something.?
f
Can you visit the URL for the API endpoint direclty?
it should give you a json object if its working
the API_HOST needs to be a routable URL from the app
j
can you give the sample URL, coz I tried below URL - APP_ORIGIN=https://growthbook.domain.com/ #API_HOST=https://api.growthbook.domain.com/
f
it needs to be a url that works
so you should be able to open that api url in a browser
you can also check the container logs
sometimes the api will not run if you set the environment to production without changing the secrets
j
Okay,ok but I followed the public repo with steps and getting the API error after mentioned the routing URL as well
image.png
f
yes, probably because that API url isn't working
have you tried to visit that url directly?
j
Yes @fresh-football-47124
Can you give an example on this.? APP_ORIGIN=http://52.16.222.216:3000/ - API_HOST=http://52.16.222.216:3100/backend/
f
you want the API to run on a directory? its not set up for that, but it is possible with some kind of rewrite rules- though this is quite advanced
j
Yes, version: "3" services: mongo: image: "mongo:latest" environment: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=password volumes: - mongodata:/data/db growthbook: image: "growthbook/growthbook:latest" ports: - "3000:3000" - "3100:3100" depends_on: - mongo environment: - APP_ORIGIN=http://52.16.222.216:3000/ - API_HOST=http://52.16.222.216:3100/ - MONGODB_URI=mongodb://root:password@mongo:27017/growthbook?authSource=admin volumes: - uploads:/usr/local/src/app/packages/back-end/uploads volumes: uploads: mongodata: I just run the yaml file, should I need to update this.? or run in the directory