Question: I was trying to use the REST API of TeamCity but i can't find a list of all supported requests and the names of parameters. I wanted to look it up in their official documentation (<https://confluence.jetbrains.com/display/TCD10/REST+API>)  

where a link to exactly this list is provided  

(<http://teamcity:8111/app/rest/application.wadl>)  

but i just can't connect to it. Seems like the page is down.

I have googled all kinds of stuff in the hope to find this list somewhere else but i couldn't find anything smart.

Does anyone know where to find such a list or can provide one? That would be fantastic.

Thanks

Answer: 
**To use `await`, its executing context needs to be `async` in nature**

As it said, you need to define the nature of your `executing context` where you are willing to `await` a task before anything.

**Just put `async` before the `fn` declaration in which your `async` task will execute.**

```
var start = async function(a, b) { 
  // Your async task will execute with await
  await foo()
  console.log('I will execute after foo get either resolved/rejected')
}

```

**Explanation:**

In your question, you are importing a `method` which is `asynchronous` in nature and will execute in parallel. But where you are trying to execute that `async` method is inside a different `execution context` which you need to define `async` to use `await`.

```
 var helper = require('./helper.js');   
 var start = async function(a,b){
     ....
     const result = await helper.myfunction('test','test');
 }
 exports.start = start;

```

**Wondering what's going under the hood**

`await` consumes promise/future / task-returning methods/functions and `async` marks a method/function as capable of using await.

Also if you are familiar with `promises`, `await` is actually doing the same process of promise/resolve. Creating a chain of promise and executes your next task in `resolve` callback.

For more info you can refer to [MDN DOCS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
I had the same problem and the following block of code was giving the same error message:

```
repositories.forEach( repo => {
        const commits = await getCommits(repo);
        displayCommit(commits);
});

```

The problem is that the method getCommits() was async but I was passing it the argument repo which was also produced by a Promise. So, I had to add the word async to it like this: async(repo) and it started working:

```
repositories.forEach( async(repo) => {
        const commits = await getCommits(repo);
        displayCommit(commits);
});

```