简体   繁体   中英

Yeoman angular dist version of app, does not restrict the direct folder access

I am facing this issue for my angular app.

Dist version of app, does not restrict the direct folder access.

so www.mysite.com/scripts and /images and /styles folder are accessible.

This issue is not coming in development ie grunt serve this is coming in grunt serve:dist.

I have tried the deny folder using .htaccess of dist folder. but doesn't help

.htaccess files are specific for apache server, but you are running grunt, so all .htaccess files are ignored.

You should not use Grunt as your production server, since it is designed to local development environment only.

Take a look here: can grunt server use for production application deployment

Files generated with grunt (in dist folder) can be copied without issues to any other sever, designed to serve files in production (nginx or apache).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM