mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	#12: Fix asset path
This commit is contained in:
		
							parent
							
								
									a9e92e95b3
								
							
						
					
					
						commit
						ab5c7d5636
					
				| @ -3,6 +3,7 @@ import path = require("path"); | |||||||
| import express = require("express"); | import express = require("express"); | ||||||
| import env = require('../services/env'); | import env = require('../services/env'); | ||||||
| import serveStatic = require('serve-static'); | import serveStatic = require('serve-static'); | ||||||
|  | import utils = require('../services/utils'); | ||||||
| 
 | 
 | ||||||
| const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>) => { | const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>) => { | ||||||
|     if (!env.isDev()) { |     if (!env.isDev()) { | ||||||
| @ -15,7 +16,14 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| function register(app: express.Application) { | function register(app: express.Application) { | ||||||
|     const root = path.join(__dirname, '..', '..', '..'); |     let root: string; | ||||||
|  |     if (!utils.isElectron()) { | ||||||
|  |       root = path.join(__dirname, '..', '..', '..'); | ||||||
|  |     } else { | ||||||
|  |       root = path.join(__dirname, '..', '..', '..', '..', '..'); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     console.log("Asset root path is", path.resolve(root)); | ||||||
|     const clientRoot = path.join(root, 'client'); |     const clientRoot = path.join(root, 'client'); | ||||||
|     const commonRoot = path.join(root, 'common');     |     const commonRoot = path.join(root, 'common');     | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran