salis在windows上assets目录不会被建立

关于salis ,一个nodejs的web mvc框架,更多请看:salis

在winsdows上安装salis后,lisft起来应用程序,默认端口1337,打开浏览器,可以看到主页。

Assets refer to static files (js, css, images, etc) on your server that you want to make accessible to the outside world. In Sails, these files are placed in the assets/ directory, where they are processed and synced to a hidden temporary directory (.tmp/public/) when you lift your app. The contents of this .tmp/public folder are what Sails actually serves - roughly equivalent to the "public" folder in express, or the "www" folder you might be familiar with from other web servers like Apache. This middle step allows Sails to prepare/pre-compile assets for use on the client - things like LESS, CoffeeScript, SASS, spritesheets, Jade templates, etc.

在assets下的资源文件,应用监听后,会被自动merge到 .tmp/public 目录下, 比如在assets 目录下,我有一个js目录,里面放着jquery.js , 那么程序起来后,我页面上链接路径写成 <script src="/js/jquery.js"></script> 即可。

问题来了。

windows的文件夹命名规则不允许包含 . 所以,.tmp不会建立,在linux上不存在这个问题。通过改salis目录中的这两个文件。更改系统加载静态的路径,即可。

修改的路径为 应用程序目录 的sails

sails\lib\app\configuration\index.js

sails\lib\hooks\http\index.js

在文件中查找 .tmp 改名为 tmp 然后手动建立tmp/public 目录,将静态资源copy进去即可。因为salis默认是自动建立这个目录,所以如果想依然自动的话,就更改grunt tasks里的路径,同样将 .tmp 替换成 tmp

在其它操作系统中不存在这样的问题。


转载于:https://my.oschina.net/u/867090/blog/336425

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值