Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default path of view files in a sails?

Tags:

sails.js

Perhaps i want to store my views in /pages directory. Next code in configs of sails directory does not reinit views path:

  paths: {
    views: path.normalize(__dirname + '/../pages')
  }

but code for public dir works well:

  paths: {
    public: path.normalize(__dirname + '/../any_public_dir')
  }

What can i do?

like image 455
Ivan Loenko Avatar asked Dec 06 '25 08:12

Ivan Loenko


1 Answers

Because of the way that Sails loads configuration, it's not currently possible to change the path for most things from within a file in the config folder. You can, however, do it in the .sailsrc file:

{
  "paths": {
    "views": "../pages"
  }
}
like image 152
sgress454 Avatar answered Dec 11 '25 07:12

sgress454



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!