# Stages in Serverless Framework

**URL:** <https://discourse.sst.dev/t/stages-in-serverless-framework/35>\
**Category:** Chapter Comments\
**Created:** [May 9, 2018, 6:39pm UTC](https://discourse.sst.dev/t/stages-in-serverless-framework/35 "2018-05-09T18:39:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cpritch](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/cpritch/32/593_2.png) [@cpritch](https://discourse.sst.dev/u/cpritch)\
**Post date:** [November 15, 2019, 12:16pm UTC](https://discourse.sst.dev/t/stages-in-serverless-framework/35/2 "2019-11-15T12:16:57Z")

</div>

Could someone help further explain how to set up stages for API endpoints?

Right now, I have 3 stages setup: DEV, STAGING, and PROD. Each work with my frontend, but only with the latest deployment. For example…

- I deploy the API to DEV, I can’t access the STAGING or PROD APIs anymore from the client.
- I deploy the API to STAGING, I can’t access the DEV or PROD APIs anymore from the client.
- I deploy the API to PROD, I can’t access the DEV or STAGING APIs anymore from the client.

I looked into it and in the API Gateway, the stages are being created without a problem. However, the lambda functions backing the API are replaced with each stage. So, if I have a DEV-{function} lambda function, when I deploy using `--stage STAGING`, it is replaced with STAGING-{function}. I would expect DEV-{function} to not get replaced and STAGING-{function} to just be added (or updated).

I think this might be me misunderstanding the concept, as it’s explained that it is better to have separate APIs, one for each stage. However, I don’t know how to set this up in the serverless.yml.

Can anyone help?  
Thanks in advance!

---

_[View the full topic](https://discourse.sst.dev/t/stages-in-serverless-framework/35)._
