salix routes static

This commit is contained in:
Vicente Falco 2017-05-15 10:44:19 +02:00
parent eacd133d00
commit d8df17ad07
3 changed files with 2 additions and 17 deletions

View File

@ -20,7 +20,7 @@ http {
root /usr/share/nginx/html;
location /static {
alias public;
alias /usr/share/nginx/html;
autoindex on;
}

View File

@ -7,7 +7,7 @@
<body>
<vn-app id="app"></vn-app>
<script type="text/javascript"
src="/salix/routes.js">
src="/static/routes.js">
</script>
<script type="text/javascript"
src="/static/bundle.manifest.js">

View File

@ -21,19 +21,4 @@ module.exports = function (app) {
res.redirect(authUrl);
}
});
app.get('/routes.js', (req, res) => {
if (true || req.cookies['salix-session']) {
// TODO: construir js dinamico de las rutas
//res.set('Content-Type', 'application/javascript');
var options = {
root: 'services/nginx/static/'
};
res.sendFile('routes.js', options);
}
else {
res.status(401);
res.send('No autorizado');
}
});
};