Skip to content

Commit

Permalink
fix: View folder location for serveDynamic()
Browse files Browse the repository at this point in the history
Before, it tried to find the `views` in the `cwd()`. This is now fixed and searches relative to the `fliegdoc` project.
  • Loading branch information
pklaschka committed Jan 7, 2021
1 parent ed1d881 commit 8c0cdde
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Express from 'express';
import MarkdownIt from 'markdown-it';
import * as fs from 'fs';
import { DEFAULT_CONFIG, FliegdocConfig, Tree } from '../model';
import * as path from 'path';
const origMd = new MarkdownIt({ linkify: true });

const md = {
Expand Down Expand Up @@ -35,6 +36,7 @@ export function serveDynamic(
};
const app = Express();

app.set('views', path.join(__dirname, '..', '..', 'views'));
app.set('view engine', 'ejs');

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

0 comments on commit 8c0cdde

Please sign in to comment.