How to import Meteor.method file

I’m still trying to figure out imports in 1.3. I’m having trouble accessing my Meteor.methods after removing insecure.
File structure:

App
  client/
    main.js
  server/
    main.js
  imports/
    api/
      methods/
        methods.js
  ui/
    myview.jsx

My Meteor.call() in myview.jsx does not seem to work and I get an access denied. I tried importing the methods.js into server/main.js with:

import '../imports/api/methods/methods.js';

Shouldn’t this register the Meteor.method with the server? I was trying to use the demo todo’s but the removing insecure page does not show how it’s imported (or I’m missing it).Do I need to export from methods.js or does importing the file run and register Meteor.methods()?

Yeah, you should just be able to import the file and have it register the methods. Perhaps you have a typo in the method name somewhere?

If you don’t want to use magic strings to define and call methods, check out the validated-method package:

Just import your method object on the client and server, and do method.call(...).

Thanks. I removed a console.log and noticed that it was still logging after the server restart… Restarting meteor fixed my problem. I should have tried that first. However it is the first time that I’ve found that saving a change did not restart meteor correctly. All working now.