Skip to content

Commit

Permalink
Merge pull request #680 from magieno/update-cli-to-use-data-mapper
Browse files Browse the repository at this point in the history
- Update.
  • Loading branch information
etiennenoel authored Mar 9, 2024
2 parents 090ec0c + 5292420 commit 27ef694
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/http/src/servers/file.http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FileHttpServer {
// extract URL path
let pathname = path.join(directory, `${parsedUrl.pathname}`);
// based on the URL path, extract the file extension. e.g. .js, .doc, ...
const ext = path.parse(pathname).ext;
let ext = path.parse(pathname).ext;
// maps file extension to MIME typere
const map: {[key in string]: string} = {
".aac": "audio/aac",
Expand Down Expand Up @@ -133,7 +133,8 @@ export class FileHttpServer {

// if is a directory search for index file matching the extension
if (fs.statSync(pathname).isDirectory()) {
pathname += 'index.html';
ext = "html";
pathname += `index.${ext}`;
}

// read file from file system
Expand Down

0 comments on commit 27ef694

Please sign in to comment.