Using Angular and Node.js / Express, is there a way to prevent a direct access to my partial .html files whilst still allowing the following route handling:
My Angular routes look like this:
$stateProvider.state('albums', {
url: '/albums',
templateUrl: '/public/albums',
controller: 'AlbumsCtrl'
});
then my express app does the following:
app.get('/public/albums', function(req, res){
res.sendfile('views/partials/albums.html');
});
This all works ok, but typing "mysite.com/public/albums" allows an access to the partial .html file. There still wouldn't be anything to see as the contents is loaded seperately and the user would need to be signed in for that, but I would still like to somehow prevent an access to this file.