mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 01:55:34 -05: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:
parent
2686f5e72a
commit
ac5d688d8c
1 changed files with 5 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue