mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	Update router for internal-api routes
This commit is contained in:
		
							parent
							
								
									44ff90a6f2
								
							
						
					
					
						commit
						f127a7beb5
					
				@ -309,12 +309,14 @@ class Server {
 | 
				
			|||||||
      })
 | 
					      })
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    router.use(express.urlencoded({ extended: true, limit: '5mb' }))
 | 
					    router.use(express.urlencoded({ extended: true, limit: '5mb' }))
 | 
				
			||||||
    router.use(express.json({ limit: '10mb' }))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    router.use('/api', this.auth.ifAuthNeeded(this.authMiddleware.bind(this)), this.apiRouter.router)
 | 
					    router.use('/api', this.auth.ifAuthNeeded(this.authMiddleware.bind(this)), this.apiRouter.router)
 | 
				
			||||||
    router.use('/hls', this.hlsRouter.router)
 | 
					    router.use('/hls', this.hlsRouter.router)
 | 
				
			||||||
    router.use('/public', this.publicRouter.router)
 | 
					    router.use('/public', this.publicRouter.router)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Skip JSON parsing for internal-api routes
 | 
				
			||||||
 | 
					    router.use(/^(?!\/internal-api).*/, express.json({ limit: '10mb' }))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Static folder
 | 
					    // Static folder
 | 
				
			||||||
    router.use(express.static(Path.join(global.appRoot, 'static')))
 | 
					    router.use(express.static(Path.join(global.appRoot, 'static')))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -404,6 +406,7 @@ class Server {
 | 
				
			|||||||
      const handle = nextApp.getRequestHandler()
 | 
					      const handle = nextApp.getRequestHandler()
 | 
				
			||||||
      await nextApp.prepare()
 | 
					      await nextApp.prepare()
 | 
				
			||||||
      router.get('*', (req, res) => handle(req, res))
 | 
					      router.get('*', (req, res) => handle(req, res))
 | 
				
			||||||
 | 
					      router.post('/internal-api/*', (req, res) => handle(req, res))
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const unixSocketPrefix = 'unix/'
 | 
					    const unixSocketPrefix = 'unix/'
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user