refactor: update findAppRoot function and adjust Dockerfile paths for consistency
This commit is contained in:
@@ -6,7 +6,7 @@ import { z } from "zod";
|
||||
import { AzureImageService } from "./azure-service";
|
||||
import { TemplateService } from "./template-service";
|
||||
|
||||
const findAppNewRoot = (): string => {
|
||||
const findAppRoot = (): string => {
|
||||
const candidates = [join(__dirname, "../../.."), join(__dirname, "../..")];
|
||||
|
||||
for (const candidate of candidates) {
|
||||
@@ -15,7 +15,7 @@ const findAppNewRoot = (): string => {
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("Unable to resolve app-new root");
|
||||
throw new Error("Unable to resolve app root");
|
||||
};
|
||||
|
||||
const queryLocation = z.object({ location: z.string().min(1) });
|
||||
@@ -143,7 +143,7 @@ const makeApp = () => {
|
||||
res.status(500).json({ message });
|
||||
});
|
||||
|
||||
const frontendRoot = join(findAppNewRoot(), "dist/frontend");
|
||||
const frontendRoot = join(findAppRoot(), "dist/frontend");
|
||||
if (existsSync(frontendRoot)) {
|
||||
app.use(express.static(frontendRoot));
|
||||
app.get(/^(?!\/api).*/, (_req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user