jaumard / trailpack-annotations

:package: Add annotation support for Tails.js applications
MIT License
7 stars 4 forks source link

Annotations on controllers declared using as async functions do not create routes #87

Open pmould opened 6 years ago

pmould commented 6 years ago

Controllers declared using async await do not support trailpack-annotations. A 404 error os returned as shown below HTTP Method: GET Request URI: http://localhost:8000/persons

{
    "statusCode": 404,
    "error": "Not Found",
    "message": "Not Found"
}

Example

  /**
   * Return some info about this application
   * @Route({method: ["GET"], path: "/person"})
   */
  async getAll(request, reply) {
    const {PersonService} = this.props.services;

    const persons = await PersonService.getAll();
    reply(persons);
  }