I'm doing a small simple Proof of Concept with NodeJS and AWS Amplify.
When I run on my local machine, the URL http://localhost:8080/api/books returns results from a simple API:
[{"title":"Harry Potter","id":1},{"title":"Twilight","id":2},{"title":"Lorien Legacies","id":3}]
I ran AWS Amplify CLI on my machine to create, deploy, build the AWS Amplify application. Those steps were successful, but when I try to access the same page URL with the AMPLIFY domain (https://master.abcdefgyijkl.amplifyapp.com/api/books/), I get this result:
<Error>
<script/>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>GF09KD45YG10T9FV</RequestId>
<HostId>+KnvI89dc3G2KGbfV+nrIZuLrDkEIRE+98PzqR0C4camFhqdDmjZR8X/i3hpIDVT9lYtmG5mIk=</HostId>
</Error>
This Stackoverflow question/answer directs me to the rewrite rules. I tried using Vinit's answer there, substituting index.js, and the result was that instead getting the "access denied" the browser displayed the source code for my index.js program. That's clearly not what I want to do.
I do not have an amplify.yaml file as mentioned in this StackOverflow.