The code was supposed to be:
let namePromise = api.getMyName(); let result = await api.hello(namePromise); console.log(result);