perak / kitchen-site

Meteor Kitchen site source code
MIT License
282 stars 38 forks source link

Add "import"-array to application level #277

Open ljack opened 8 years ago

ljack commented 8 years ago

Add "import"-array to application level so that code in server startup section can work. E.g. doesn't compile because of Apimoons is undefined.

import {Users} from "meteor-user-roles";

Meteor.startup(function() {
    // read environment variables from Meteor.settings
    if(Meteor.settings && Meteor.settings.env && _.isObject(Meteor.settings.env)) {
        for(var variableName in Meteor.settings.env) {
            process.env[variableName] = Meteor.settings.env[variableName];
        }
    }
Apimoons.insert( {name:"Apimoon"});

});

so to fix it you need to import the Apimoon

import {Users} from "meteor-user-roles";
import {Apimoons} from "/lib/collections/apimoons.js";

Meteor.startup(function() {
    // read environment variables from Meteor.settings
    if(Meteor.settings && Meteor.settings.env && _.isObject(Meteor.settings.env)) {
        for(var variableName in Meteor.settings.env) {
            process.env[variableName] = Meteor.settings.env[variableName];
        }
    }

Apimoons.insert( {name:"Apimoon"});

});
ljack commented 8 years ago

Also needed to the client startup section. So: client_imports and server_imports