Changing the default Sails public folder

I know from experience that Sails creates a ./.tmp/public/ folder from where it serves all my files. I'd like to change it to just ./public/

I read a GitHub issue that said I could do it in config/local.js, but that doesn't seem to be working. Here's the GitHub issue: https://github.com/balderdashy/sails/issues/709

Is there a way to accomplish this? Thanks.

As to why I'm trying to do this, it's because I'm actually trying to work with Sails and Parse to build a simple test application. Since Parse looks in the ./public/ directory by default and I couldn't find a way to change this behaviour, I'm trying to configure Sails.

Answers


If your using out of the box Grunt tasks, then you will need to go through and edit those tasks in <root>/tasks/config, there does not seem to be an global config variable for this, so you might have touch each file.

http://sailsjs.org/documentation/anatomy/my-app/tasks/config


As in the mentioned issue report it can either be done in the .sailsrc file

{
  "paths": {
    "public": "bar/foo"
  } 
}

or if you launch sails in your own app (no using sails lift)

var Sails = require('sails');
Sails.lift({
  paths: { public: 'mydir/pub' }, // relative to appDir
}, function(err, server) {});

Create a file config/paths.js with the value:

module.exports.paths = { 'public': 'assets/'};


Need Your Help

Clear selected option in Select2

javascript jquery jquery-select2 jquery-select2-4

I have new problem with my Select2 option. I can't clear my select box.

Cropping the liquid region of a bottle for processing

opencv image-processing emgucv

Basically what I want to do is to filter out only the liquid region of the bottle for further processing. So the next processes would apply only for that region.