fix: improve paths for windows os
This commit is contained in:
@@ -7,7 +7,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const appAssetsHandler = async (app) => {
|
||||
app.use('/apps/:appKey/assets/favicon.svg', (req, res, next) => {
|
||||
const { appKey } = req.params;
|
||||
const svgPath = `${__dirname}/../apps/${appKey}/assets/favicon.svg`;
|
||||
const svgPath = path.resolve(`${__dirname}/../apps/${appKey}/assets/favicon.svg`);
|
||||
const staticFileHandlerOptions = {
|
||||
/**
|
||||
* Disabling fallthrough is important to respond with HTTP 404.
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import path from 'node:path';
|
||||
import path, { join } from 'path';
|
||||
import fs from 'node:fs';
|
||||
import omit from 'lodash/omit.js';
|
||||
import cloneDeep from 'lodash/cloneDeep.js';
|
||||
import addAuthenticationSteps from './add-authentication-steps.js';
|
||||
import addReconnectionSteps from './add-reconnection-steps.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { fileURLToPath, pathToFileURL } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
@@ -14,7 +14,7 @@ const apps = fs
|
||||
if (!dirent.isDirectory()) return apps;
|
||||
|
||||
apps[dirent.name] = import(
|
||||
path.resolve(__dirname, '../apps', dirent.name, 'index.js')
|
||||
pathToFileURL(join(__dirname, '../apps', dirent.name, 'index.js'))
|
||||
);
|
||||
|
||||
return apps;
|
||||
|
Reference in New Issue
Block a user