meteor-rest icon indicating copy to clipboard operation
meteor-rest copied to clipboard

re #106 - config for customizing paths

Open zeroasterisk opened this issue 8 years ago • 3 comments

re #106 - config for customizing paths

SimpleRest._config = {
  urlTransform: (type, name) => {
    if (type === 'method') return `${SimpleRest._config.methodUrlPrefix}${name}`,
    if (type === 'publications') return `${SimpleRest._config.publicationUrlPrefix}${name}`,
    throw new Meteor.Error(404, `Unkown REST type: ${type} name: ${name}`);
  },
  methodUrlPrefix: 'methods/',
  publicationUrlPrefix: 'publications/',
};

zeroasterisk avatar Jun 12 '16 22:06 zeroasterisk

Hey I'm currently on vacation so I'll only be able to look at this a week from now. Sorry!

stubailo avatar Jun 13 '16 09:06 stubailo

yeah - no problem - enjoy the beach (or whatever)

zeroasterisk avatar Jun 13 '16 15:06 zeroasterisk

Any update on this, or the other PRs on this repo?

sidenote

I think this is a great addition to Meteor, and should be considered almost a requirement, allowing Meteor devs to to expose meteor methods and other functionality via REST api... I'd love to see a simple GraphQL stack on top of this, perhaps with this https://github.com/kuip/meteor-schema-graphql-bridge

zeroasterisk avatar Nov 21 '17 03:11 zeroasterisk