Search code examples
serverless-framework

How to capture the URL of your serverless deployment in Bash?


After doing serverless deploy, how can I set URL which my serverless application gets deployed to a variable. This is useful for me because then I can use this URL in the future to pass down to my Javascript website when it's built.


Solution

  • For those who need this, I ended up doing the following:

    URL="$(serverless info --verbose | grep ServiceEndpoint | sed s/ServiceEndpoint\:\ //g)"
    

    Will set the variable URL, to your serverless app endpoint.