Skip to content

Wrap collection endpoints #73

@clarkie

Description

@clarkie

Hi, I'm trying to add halacious to an existing REST api and can't find how to do so for collection end points.

For example the following returns an array of pieces:

{ 
    method: 'GET', 
    path: '/volumes/{id}/pieces', 
    config: {
      tags: ['api'],
      handler: function (request, reply) {
        var query = request.db.piece.findAll({
          where : { volumeId: request.params.id }
        });
        return reply(query);
      },
      validate: {
        params: {
          id: Joi.number().required()
        }
      }
    }
  }

Is this possible already or would this be a new feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions