ion
ion copied to clipboard
Creating an API doesn't naturally output the URL
If you follow the AWS API tutorial , in step 2 it instructs you to run npx sst dev which in turn should give you the APIGW invoke URL for the API.
It doesn't do this - here is what I got in my attempt.
I posted this issue within the Discord, and for anyone else who runs into this issue, and I was told you can return the URL in the run() block with something like (not tested this yet)
async run() {
const api = new sst.aws.ApiGatewayV2("MyApi");
api.route("GET /", {
handler: "index.upload",
});
api.route("GET /latest", {
handler: "index.latest",
});
return {
url: api.url
}
}