This commit is contained in:
Eugene Pankov
2021-07-26 18:34:18 +02:00
parent 3a9b3e885b
commit 103dcea95b
3 changed files with 3 additions and 5 deletions

View File

@@ -8,10 +8,8 @@ export class UniversalInterceptor implements HttpInterceptor {
constructor (private commonService: CommonService) { } constructor (private commonService: CommonService) { }
intercept (request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept (request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
console.log(request.url)
if (!request.url.startsWith('//') && request.url.startsWith('/')) { if (!request.url.startsWith('//') && request.url.startsWith('/')) {
const endpoint = request.url const endpoint = request.url
console.log(this.commonService.backendURL, request.url)
request = request.clone({ request = request.clone({
url: `${this.commonService.backendURL}${endpoint}`, url: `${this.commonService.backendURL}${endpoint}`,
withCredentials: true, withCredentials: true,

View File

@@ -31,11 +31,11 @@ function start () {
app.set('view engine', 'html') app.set('view engine', 'html')
app.set('views', DIST_FOLDER) app.set('views', DIST_FOLDER)
app.get('*.*', express.static(join(DIST_FOLDER, 'static'), { app.use('/static', express.static(DIST_FOLDER, {
maxAge: '1y', maxAge: '1y',
})) }))
app.get('*', (req, res) => { app.get(['/', '/app', '/login'], (req, res) => {
res.render('index', { req }) res.render('index', { req })
}) })

View File

@@ -34,7 +34,7 @@ module.exports = {
// libraryTarget: 'commonjs', // libraryTarget: 'commonjs',
path: outputPath, path: outputPath,
pathinfo: true, pathinfo: true,
publicPath: '/', publicPath: '/static/',
filename: '[name].js', filename: '[name].js',
chunkFilename: '[name].bundle.js', chunkFilename: '[name].bundle.js',
}, },