mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-16 22:36:02 +01:00
.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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 })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user