Skip to content

Commit

Permalink
fix(service): construct dir to dashboard files
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Sep 23, 2022
1 parent 63dc7a5 commit 8adeea6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ export async function startServer(port: number = 4567, serveDashboard = false) {
const versionString = `Nandu NPM Registry v${pkg.version}`;

if (serveDashboard) {
const { distDir } = require("@nanduland/dashboard");
app.use(express.static(distDir));
const path = require("path");
const dashboardDistDir = path.resolve(
`${getPkgJsonDir()}/../dashboard/dist`
);
app.use(express.static(dashboardDistDir));
} else {
app.get("/", (req: Request, res: Response) => {
res.status(200).send(versionString);
Expand Down

0 comments on commit 8adeea6

Please sign in to comment.