title: How to deploy a serverless code into a stage in AWS API Gateway
body: <p>To deploy a serverless project into a stage of a service, following command can be used</p>
  
  <blockquote>
    <p>serverless deploy --stage dev</p>
  </blockquote>
  
  <p><em>Extracted from the docs</em>
  <a href="https://serverless.com/framework/docs/providers/aws/guide/deploying/" rel="nofollow noreferrer">https://serverless.com/framework/docs/providers/aws/guide/deploying/</a></p>
  
  <p>However when above command is used to deploy a service, it creates a new service with name <strong>dev-aws-nodejs</strong> in API Gateway. </p>
  
  <p>Is it possible to create a service with name <strong>aws-nodejs</strong> and have different stages like dev, stag, prod etc.. Therefore, when you run the following command</p>
  
  <blockquote>
    <p>serverless deploy --stage stag</p>
  </blockquote>
  
  <p>A new stage called <strong>stag</strong> will be created under service <strong>aws-nodejs</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/anAmx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/anAmx.jpg" alt="enter image description here"></a></p>