Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

re #106 - config for customizing paths #109

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

zeroasterisk
Copy link

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/',
};

Carl Evans and others added 2 commits May 22, 2016 01:19
This commit makes the default URL prefixes for methods and publications
configurable through SimpleSchema.configure()
To set the prefix for methods, pass methodUrlPrefix
To set the prefix for publications, pass publicationUrlPrefix
Allowing users to set config function to transform URL paths
stubailo#106
  urlTransform: (type, name) => <urlPath>
@stubailo
Copy link
Owner

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

@zeroasterisk
Copy link
Author

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

@zeroasterisk
Copy link
Author

zeroasterisk commented Nov 21, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants