rest - How to define API keys in restFul meteor? -


i new rest api in meteorjs. trying run example explained in the meteor chef getting error:

referenceerror: apikeys not defined     @ object.api.authentication (api/config/api.js:4:19)     @ object.api.connection (api/config/api.js:16:34)     @ object.api.handlerequest (api/config/api.js:28:26)     @ [object object].router.route.where (api/pizza.js:9:9)     @ boundnext (packages/iron_middleware-stack/lib/middleware_stack.js:251:1)     @ runwithenvironment (packages/meteor/dynamics_nodejs.js:110:1)     @ packages/meteor/dynamics_nodejs.js:123:1     @ [object object].urlencodedparser (/users/mac/.meteor/packages/iron_router/.1.0.12.13720an++os+web.browser+web.cordova/npm/node_modules/body-parser/lib/types/urlencoded.js:84:40)     @ packages/iron_router/lib/router.js:277:1     @ [object object]._.extend.withvalue (packages/meteor/dynamics_nodejs.js:56:1) 

the code same explained in example

it because didn't created apikeys mongo collection shown here: https://github.com/themeteorchef/writing-an-api/blob/master/code/collections/api-keys.js

add file project , it'll work.

here explanation post linked:

next, try insert new key our user apikeys collection. wait minute! did come from?! collection setup beforehand, let’s talk why have separate collection begin with. reason want separate our api key storage more predictable location of our user’s profile (the writable portion of user’s record in meteor.users() collection) default, profile object writable.

so missed part of tutorial created apikeys collection.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -