From c6b3325e503d81dc4d8d89dbb7c0404779406c4e Mon Sep 17 00:00:00 2001 From: Ashoat Tevosyan Date: Mon, 5 Apr 2021 16:29:04 -0400 Subject: [PATCH] [server] Create landing_compiled symlink and move old compiled symlink to app_compiled Test Plan: Make sure server still returns a working website Reviewers: atul, palys-swm Reviewed By: atul Subscribers: KatPo, zrebcu411, Adrian, subnub Differential Revision: https://phabricator.ashoat.com/D968 --- .eslintignore | 3 ++- .prettierignore | 3 ++- server/{compiled => app_compiled} | 0 server/landing_compiled | 1 + server/src/responders/website-responders.js | 4 ++-- server/src/server.js | 9 ++++++++- 6 files changed, 15 insertions(+), 5 deletions(-) rename server/{compiled => app_compiled} (100%) create mode 120000 server/landing_compiled diff --git a/.eslintignore b/.eslintignore index 90390fd797..2d04417b21 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,7 +3,8 @@ lib/node_modules web/dist web/flow-typed web/node_modules -server/compiled +server/app_compiled +server/landing_compiled server/dist server/secrets server/facts diff --git a/.prettierignore b/.prettierignore index 4fe87f4b5d..129f0b86d4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,8 @@ lib/flow-typed web/dist web/flow-typed -server/compiled +server/app_compiled +server/landing_compiled server/dist server/secrets server/facts diff --git a/server/compiled b/server/app_compiled similarity index 100% rename from server/compiled rename to server/app_compiled diff --git a/server/landing_compiled b/server/landing_compiled new file mode 120000 index 0000000000..7c811cd8a8 --- /dev/null +++ b/server/landing_compiled @@ -0,0 +1 @@ +../landing/dist/ \ No newline at end of file diff --git a/server/src/responders/website-responders.js b/server/src/responders/website-responders.js index 5397603bbb..41f368bbf7 100644 --- a/server/src/responders/website-responders.js +++ b/server/src/responders/website-responders.js @@ -77,8 +77,8 @@ async function getAssetInfo() { }; return assetInfo; } - // $FlowFixMe compiled/assets.json doesn't always exist - const { default: assets } = await import('../../compiled/assets'); + // $FlowFixMe app_compiled/assets.json doesn't always exist + const { default: assets } = await import('../../app_compiled/assets'); assetInfo = { jsURL: `compiled/${assets.browser.js}`, fontsURL: googleFontsURL, diff --git a/server/src/server.js b/server/src/server.js index 1a4afa4146..a6a845327a 100644 --- a/server/src/server.js +++ b/server/src/server.js @@ -58,7 +58,14 @@ if (cluster.isMaster) { process.env.NODE_ENV === 'dev' ? undefined : { maxAge: '1y', immutable: true }; - router.use('/compiled', express.static('compiled', compiledFolderOptions)); + router.use( + '/compiled', + express.static('app_compiled', compiledFolderOptions), + ); + router.use( + '/commlanding/compiled', + express.static('landing_compiled', compiledFolderOptions), + ); router.use('/', express.static('icons')); for (const endpoint in jsonEndpoints) {