yasaricli / tatsy

A simple interface for creating REST APIs

Repository from Github https://github.comyasaricli/tatsyRepository from Github https://github.comyasaricli/tatsy

Collection override endpoints

yasaricli opened this issue · comments

example:

Tatsy.Collection({
  name: 'articles',

  endpoints: {
    async getAll() {
      const list = await this.collections.articles.find({ });
      return { list }
    },

    get(_id) {},
    post(body) {},
    delete(_id) {},
    put(_id, body) {},
  }
});

endpoints

  • getAll
  • get
  • post
  • delete
  • put