Skip to content

Commit

Permalink
Fix incorrect frontend rendering
Browse files Browse the repository at this point in the history
* Fix UI router path

* 8.4.7-rc.10
  • Loading branch information
sudharsan-selvaraj authored Feb 18, 2024
1 parent 4adf375 commit 86f6eb2
Show file tree
Hide file tree
Showing 5 changed files with 8,580 additions and 8,572 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appium-device-farm",
"version": "8.4.7-rc.9",
"version": "8.4.7-rc.10",
"description": "An appium 2.0 plugin that manages and create driver session on available devices",
"main": "./lib/src/main.js",
"scripts": {
Expand Down
12 changes: 10 additions & 2 deletions src/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express from 'express';
import path from 'path';

import fs from 'fs';
import { getCLIArgs } from '../data-service/pluginArgs';
import cors from 'cors';
import AsyncLock from 'async-lock';
Expand Down Expand Up @@ -54,7 +54,15 @@ apiRouter.get('/cliArgs', async (req, res) => {
res.json(await getCLIArgs());
});

staticFilesRouter.use(express.static(path.join(__dirname, 'public')));
if (
fs.existsSync(path.join(__dirname, 'public')) &&
fs.statSync(path.join(__dirname, 'public')).isDirectory()
) {
staticFilesRouter.use(express.static(path.join(__dirname, 'public')));
} else {
staticFilesRouter.use(express.static(path.join(__dirname, '..', '..', 'public')));
}

router.use('/api', apiRouter);
router.use('/assets', express.static(config.sessionAssetsPath));
router.use(staticFilesRouter);
Expand Down
2 changes: 1 addition & 1 deletion src/modules
Loading

0 comments on commit 86f6eb2

Please sign in to comment.