Skip to content

Commit 8c0cdde

Browse files
committed
fix: View folder location for serveDynamic()
Before, it tried to find the `views` in the `cwd()`. This is now fixed and searches relative to the `fliegdoc` project.
1 parent ed1d881 commit 8c0cdde

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/server/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Express from 'express';
22
import MarkdownIt from 'markdown-it';
33
import * as fs from 'fs';
44
import { DEFAULT_CONFIG, FliegdocConfig, Tree } from '../model';
5+
import * as path from 'path';
56
const origMd = new MarkdownIt({ linkify: true });
67

78
const md = {
@@ -35,6 +36,7 @@ export function serveDynamic(
3536
};
3637
const app = Express();
3738

39+
app.set('views', path.join(__dirname, '..', '..', 'views'));
3840
app.set('view engine', 'ejs');
3941

4042
app.get(`${finalConfig.baseUrl}`, (req, res) => {

0 commit comments

Comments
 (0)