• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: stage is not added to the endpoint when deploy with sls deploy –stage dev

Resolved: stage is not added to the endpoint when deploy with sls deploy –stage dev

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am using serverless framework. I have set the stage as the dev and deploying using sls deploy –stage dev command. The dev stage is not added to the end point. The endpoints are not like the one given below:
One of my lambda functions needs an endpoint to submit a post request to a third-party API to post back the result. I need to be sure that the endpoint is rightly sent from the production/dev stage.
As you can see the above postback url is wrong if I do not get the stage (process.env.stage) added to the endpoint.
serverless.yml

Answer:

Serverless Framework does things a bit differently and instead of using stages of APIGW, it creates a totally new APIGW for each stage, that’s why you don’t see the prefix in your path with the stage name, but if you observe the url, you’ll see that the base url will be different across stages. That’s how you can differentiate between them.

If you have better answer, please add a comment about this, thank you!

aws-sdk-nodejs aws-serverless serverless-framework
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to set consistent decimal separators in R data frame?

26/03/2023

Resolved: How to resolve LNK2001 in c++ projects

26/03/2023

Resolved: How to correctly initialize vector of number in Typescript

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.