Add a more complex logger to Flipper UI Browser

Reviewed By: passy, lblasa

Differential Revision: D50223987

fbshipit-source-id: 108e1753b555c7d7b32d3fc2408c2f8efcbadb4d
This commit is contained in:
Andrey Goncharov
2023-10-16 09:27:50 -07:00
committed by Facebook GitHub Bot
parent 8a11043f37
commit ee7736caee
7 changed files with 95 additions and 76 deletions

View File

@@ -8,3 +8,4 @@
*/
export const isFBBuild: boolean = false;
export const GRAPH_SECRET = '';

View File

@@ -21,6 +21,7 @@ import {FlipperServerCompanionEnv} from 'flipper-server-companion';
import {validateAuthToken} from '../app-connectivity/certificate-exchange/certificate-utils';
import {tracker} from '../tracker';
import {EnvironmentInfo, isProduction} from 'flipper-common';
import {GRAPH_SECRET} from '../fb-stubs/constants';
type Config = {
port: number;
@@ -147,7 +148,11 @@ async function startHTTPServer(
? path.join(config.staticPath, config.entry)
: path.join(config.staticPath, 'loading.html');
fs.readFile(resource, (_err, content) => {
res.end(content);
const processedContent = content
.toString()
.replace('GRAPH_SECRET_REPLACE_ME', GRAPH_SECRET)
.replace('FLIPPER_APP_VERSION_REPLACE_ME', environmentInfo.appVersion);
res.end(processedContent);
});
});