Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

5. New Method

Timothy Voice edited this page Jun 10, 2016 · 1 revision

####Command meteor-maker g:method <name>

Will add a new method to the methods.js file of API you select in the prompts with the following format:

export const methodName = new ValidatedMethod({
  name: 'methodName.method',
  validate: new SimpleSchema({
    argument: { type: String },
  }).validator(),
  run({ arg }) {
    // your method code here
  }
});

It uses the atmosphere package mdg:validated-method to cut down on boilerplate from the guide's recommended method format. See here for details.

####Prompts

#####Select: API Select from a list of current APIs, which API this method should be added to.

Clone this wiki locally