HJW
HJW

Reputation: 1032

API request fails on Travis-CI

I have a React App with multiple passing tests. When running them through Travis, I get the following error:

API request failed. Message: The requested API endpoint was not found. Are you using the right HTTP verb (i.e.GETvs.POST), and did you specify your intended version with theAcceptheader?

I use the .env to set a variable to the heroku URL. Then i set the same variable in the Travis .env on their website. I suspect that the API fails for the action tests, but I can't seem to fix it.

Anyone had a similar experience and knows where to fix the issues? Will provide any additional code examples

Upvotes: 0

Views: 779

Answers (1)

HJW
HJW

Reputation: 1032

Fixed it by doing this:

deploy:
  provider: heroku
  api_key:
    secure: ENCRYPTED-PW
  app: boiling-spring-21825  <------------
  on:
    repo: xyz/project-name

Before, I had the app name as https://boiling-spring-21825:21825, hence Travis was unable to fetch the project from heroku. I can imagine the API was looking for https://boiling-spring-21825:21825/https://boiling-spring-21825:21825 or something similar that didn't make sense.

Lesson here is to only write out the simple heroku app name as found in your heroku projects page.

Upvotes: 1

Related Questions