Skip to content

Instantly share code, notes, and snippets.

@Pent
Last active December 18, 2015 13:58
Show Gist options
  • Select an option

  • Save Pent/5793360 to your computer and use it in GitHub Desktop.

Select an option

Save Pent/5793360 to your computer and use it in GitHub Desktop.
Check Meteor for bundled or development environment
var path = Npm.require("path");
var base = path.resolve('.');
if (base == '/'){
base = path.dirname(global.require.main.filename);
}
var publicPath = path.resolve(base+'/public/');
var staticPath = path.resolve(base+'/static/');
if (path.existsSync(staticPath)){
//code for server
} else {
//code for development
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment