hey guys, I'm trying to communicate with the backe...
# help
t
hey guys, I'm trying to communicate with the backend from the client (in the serverless stack tutorial) but i get a 502 error saying
Copy code
{
  "message": "Missing Authentication Token"
}
a
The token should get printed out in the console when you run SST
t
I'm sorry, I'm a total noob what is SST
what do you mean by that I mean
a
SST = Serverless Stack! 🙂
You should have a bit that looks like
_this_.addOutputs({
which prints out bits (docs link)
You using
API
or
AppSync
or something else?
t
sorry, I dont' quite get where I should see the this.addOutputs({ part, also I'm using aws API gateway which I got through runnin serverless deploy on my backend
a
this.addOutputs
goes inside your
sst.Stack
constructor 🙂 under where you probably have
const api = new sst.Api(this, 'Api', {
or similar
r
From earlier conversations, I think @TrashyDev is using serverless framework rather than SST
t
Oh right, I am sorry my terminology is trashy as my name suggest
s
r
Can you share the link to the section of the docs you're looking at?
t
I basically finished the serverless stack tutorial the basic one
I'm just having issues with this atm, I don't think its cors doe
Something to do with the API gateway probably
r
which one though, there is one for SST and an older one for Serverless Framework
t
This one
The basics one
r
Yeah, think that's for serverless framework
The SST is more example based
t
Where can I find that one
r
t
Okay thank you, but there is not a similar project as an end product like in the one I'm doing
r
It's down to your preference, the big benefit of SST is the ability to live debug lambda functions. There are constructs now for APIs backing static sites with examples for React, Vue etc
t
Oh okay, thanks 😄
j
Yeah the guide is still using the older setup. We’ll be working on moving it over.
But for the older setup, did the steps in the chapter work for you? https://serverless-stack.com/chapters/test-the-apis.html
If that works, then it should work fine in the frontend as well.
r
Yeah, missing authentication token often means that the route is incorrect in some way
j
Ah yeah that’s a good point.
It’s a very misleading error.
r
Yeah, it's confused the heck out of me in the past. Not hard, granted