# Testing the endpoints after deployment

**URL:** <https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791>\
**Category:** Serverless Framework\
**Tags:** aws, release\
**Created:** [September 29, 2017, 4:05am UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791 "2017-09-29T04:05:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![balassy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/balassy/32/1095_2.png) [@balassy](https://forum.serverless.com/u/balassy)\
**Post date:** [September 29, 2017, 4:05am UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/1 "2017-09-29T04:05:57Z")

</div>

I would like to run tests after `sls deploy`, so I can verify that the deployment completed successfully, and all components on my backend are working perfectly. To do so, I want to call the endpoints deployed to `https://{restApiId}.execute-api.{region}.amazonaws.com/{stage}/{path}`.

What is the easiest way to pass those parameters, or at least the base URL to a post deployment npm script?

For example, is there a way to export them to a file during deployment? I am considering writing a plugin to do that, but before that I would like to know if there is an easier and recommended way.

Thank you.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [October 18, 2017, 10:25pm UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/2 "2017-10-18T22:25:25Z")

</div>

I think the “vanilla” way to do this would be parse the output of the `sls deploy` or `sls info` commands and test those.

You could also get the stack outputs (which include the endpoints) and test those, so you don’t have to parse text.

---

<div class="post-metadata">

**Author:** ![redroot](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/redroot/32/1151_2.png) [@redroot](https://forum.serverless.com/u/redroot)\
**Post date:** [October 20, 2017, 3:02pm UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/3 "2017-10-20T15:02:00Z")

</div>

I was considering the same problem yesterday, as far as I can tell nothing currently exists to output the stack outputs to a file. In bash I managed to come up with this:

`serverless info --verbose | grep ServiceEndpoint | sed s/ServiceEndpoint\:\ //g | awk '{print $1"/your-path"}' | xargs -n1 curl`

Not the prettiest, and I’m trying to work a way to make it into a plugin at the moment or at least aliasable in bash!

---

<div class="post-metadata">

**Author:** ![balassy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/balassy/32/1095_2.png) [@balassy](https://forum.serverless.com/u/balassy)\
**Post date:** [October 21, 2017, 2:02am UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/4 "2017-10-21T02:02:35Z")

</div>

Thank you @redroot, `sls info` seems to be the good way to start. However, if you have a custom domain and use the `serverless-domain-manager` plugin, the name of the domain is not printed in the info output. But I guess that is something I should report to the plugin author.

I highly appreciate your efforts embedding this to a plugin.

---

<div class="post-metadata">

**Author:** ![redroot](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/redroot/32/1151_2.png) [@redroot](https://forum.serverless.com/u/redroot)\
**Post date:** [October 23, 2017, 10:02am UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/5 "2017-10-23T10:02:21Z")

</div>

@balassy that’s a shame, does `serverless info --verbose` also not print it out?

---

<div class="post-metadata">

**Author:** ![balassy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/balassy/32/1095_2.png) [@balassy](https://forum.serverless.com/u/balassy)\
**Post date:** [October 24, 2017, 2:59am UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/6 "2017-10-24T02:59:04Z")

</div>

@redroot: No, even with the `--verbose` parameter the custom domain does not get printed to the output, so I’ve created an issue for that: [https://github.com/amplify-education/serverless-domain-manager/issues/35](https://github.com/amplify-education/serverless-domain-manager/issues/35)

---

<div class="post-metadata">

**Author:** ![balassy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/balassy/32/1095_2.png) [@balassy](https://forum.serverless.com/u/balassy)\
**Post date:** [October 27, 2017, 9:08pm UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/7 "2017-10-27T21:08:00Z")

</div>

Thanks to @jconstance-amplify the 1.1.16 version of the serverless-domain-manager package prints the name of the custom domain in the `sls info --verbose` output.

---

<div class="post-metadata">

**Author:** ![balassy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/balassy/32/1095_2.png) [@balassy](https://forum.serverless.com/u/balassy)\
**Post date:** [October 27, 2017, 9:13pm UTC](https://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791/8 "2017-10-27T21:13:59Z")

</div>

FYI: I started another discussion on producing a computer friendly output in `sls info`:

> [@Output sls info to JSON](http://forum.serverless.com/t/output-sls-info-to-json/2979):
>
> Is there a way to get the output of sls info --verbose in a more JavaScript friendly way, for example in JSON? Related topic: [Testing the endpoints after deployment](http://forum.serverless.com/t/testing-the-endpoints-after-deployment/2791)
