Skip to content

Commit

Permalink
resolve relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 15, 2024
1 parent 5524e26 commit 6f3c263
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import express, { Response } from 'express';
import Formidable from 'formidable';
import { createReadStream } from 'node:fs';
import { join, basename, relative } from 'node:path';
import { join, basename, relative, resolve } from 'node:path';
import assert from 'node:assert';
import * as fs from 'node:fs/promises';
import morgan from 'morgan';
Expand Down Expand Up @@ -34,7 +34,7 @@ export default ({ sharedPath: sharedPathIn, port, maxUploadSize, zipCompressionL
devMode: boolean,
}) => {
// console.log({ sharedPath: sharedPathIn, port, maxUploadSize, zipCompressionLevel });
const sharedPath = sharedPathIn || process.cwd();
const sharedPath = sharedPathIn ? resolve(sharedPathIn) : process.cwd();

function arePathsEqual(path1: string, path2: string) {
return relative(path1, path2) === '';
Expand Down

0 comments on commit 6f3c263

Please sign in to comment.