-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouting.js
45 lines (36 loc) · 1.54 KB
/
routing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var authenticationHelpers = require('./01_Commons/authenticationHelpers');
module.exports = function (provider) {
var publicDir = __dirname + '/public/';
var css = publicDir; // + "css/";
var js = publicDir;// + "js/";
var fonts = publicDir;
provider.get(['/billings/*/*.pdf'],
function (req, res) {
res.sendFile(__dirname + req.originalUrl);
});
provider.get(['/', '*/app/components/*.html', '*/app/shared/*.html'],
function (req, res) {
res.sendFile(publicDir + req.originalUrl);
});
provider.get(['*/app/app.js', '*/app/routing.js', '*/assets/libs/*.js',
'*/assets/js/*.js', '*/app/components/*.js', '*/app/shared/*.js'],
function (req, res) {
res.sendFile(js + req.originalUrl);
});
provider.get(['*/node_modules/angular-aria/*.js', '*/node_modules/angular/*.js',
'*/node_modules/angular-material/*.js', '*/node_modules/angular-material/*.css', '*/node_modules/angular-wizard/*.js', '*/node_modules/angular-animate/*.js'],
function (req, res) {
res.sendFile(__dirname + req.originalUrl);
});
provider.get('*.css', function (req, res) {
res.sendFile(css + req.originalUrl);
});
provider.get(['*.woff', '*.ttf', '*.woff2'], function (req, res) {
res.sendFile(fonts + req.path);
});
function getUserAuthenticated(req, res) {
res.send(req.user);
}
provider.get('/isAuthenticated', authenticationHelpers.ensureAuthorized, getUserAuthenticated);
}
;