mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
Merge pull request #2612 from overleaf/bg-precompile-web-views-only
only precompile views for web, not web-api GitOrigin-RevId: 292f4d5dd6f81b1928ccd543898dfa643f1e5be8
This commit is contained in:
@@ -173,12 +173,6 @@ expressLocals(webRouter, privateApiRouter, publicApiRouter)
|
||||
|
||||
webRouter.use(SessionAutostartMiddleware.invokeCallbackMiddleware)
|
||||
|
||||
if (app.get('env') === 'production') {
|
||||
logger.info('Production Enviroment')
|
||||
app.enable('view cache')
|
||||
Views.precompileViews(app)
|
||||
}
|
||||
|
||||
webRouter.use(function(req, res, next) {
|
||||
if (Settings.siteIsOpen) {
|
||||
next()
|
||||
@@ -240,6 +234,11 @@ const enableWebRouter =
|
||||
if (enableWebRouter || notDefined(enableWebRouter)) {
|
||||
logger.info('providing web router')
|
||||
|
||||
if (app.get('env') === 'production') {
|
||||
logger.info('precompiling views for web in production environment')
|
||||
Views.precompileViews(app)
|
||||
}
|
||||
|
||||
app.use(publicApiRouter) // public API goes with web router for public access
|
||||
app.use(Validation.errorMiddleware)
|
||||
app.use(HttpErrorController.handleError)
|
||||
|
||||
Reference in New Issue
Block a user