serve devserver on same base path

This commit is contained in:
Simon Knott 2024-10-23 13:44:41 +02:00
parent f32f9caaeb
commit c7a72b6a04
2 changed files with 5 additions and 4 deletions

View file

@ -125,12 +125,13 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
for (const reporter of options.reporter || [])
params.append('reporter', reporter);
let baseUrl = './trace/';
let baseUrl = '';
if (process.env.PW_HMR === '1') {
params.set('testServerPort', '' + server.port());
baseUrl = 'http://localhost:44223/'; // port is hardcoded in build.js
baseUrl = 'http://localhost:44223'; // port is hardcoded in build.js
}
const urlPath = `${baseUrl}${options.webApp || 'index.html'}?${params.toString()}`;
const urlPath = `${baseUrl}/trace/${options.webApp || 'index.html'}?${params.toString()}`;
server.routePath('/', (_, response) => {
response.statusCode = 302;

View file

@ -310,7 +310,7 @@ steps.push({
if (watchMode) {
steps.push({
command: 'npx',
args: ['vite', '--port', '44223'],
args: ['vite', '--port', '44223', '--base', '/trace/'],
shell: true,
cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'),
concurrent: true,