Fix token replacements

Reviewed By: lblasa

Differential Revision: D51196650

fbshipit-source-id: 184c104b32a1d619163c799ae70419e6aad23e98
This commit is contained in:
Andrey Goncharov
2023-11-10 03:35:14 -08:00
committed by Facebook GitHub Bot
parent 6e19c4155c
commit 8348d617d0

View File

@@ -7,7 +7,7 @@
* @format * @format
*/ */
import express, {Express} from 'express'; import express, {Express, RequestHandler} from 'express';
import http from 'http'; import http from 'http';
import path from 'path'; import path from 'path';
import fs from 'fs-extra'; import fs from 'fs-extra';
@@ -154,7 +154,7 @@ async function startHTTPServer(
next(); next();
}); });
app.get('/', async (_req, res) => { const serveRoot: RequestHandler = async (_req, res) => {
const resource = isReady const resource = isReady
? path.join(config.staticPath, config.entry) ? path.join(config.staticPath, config.entry)
: path.join(config.staticPath, 'loading.html'); : path.join(config.staticPath, 'loading.html');
@@ -169,7 +169,10 @@ async function startHTTPServer(
.replace('FLIPPER_SESSION_ID_REPLACE_ME', sessionId); .replace('FLIPPER_SESSION_ID_REPLACE_ME', sessionId);
res.end(processedContent); res.end(processedContent);
}); });
}); };
app.get('/', serveRoot);
app.get('/index.web.html', serveRoot);
app.get('/index.web.dev.html', serveRoot);
app.get('/ready', (_req, res) => { app.get('/ready', (_req, res) => {
tracker.track('server-endpoint-hit', {name: 'ready'}); tracker.track('server-endpoint-hit', {name: 'ready'});