mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-24 15:49:42 +02:00
Docker image optimization (#150)
This commit is contained in:
parent
8d9c19e595
commit
c6e2db0245
15 changed files with 167 additions and 2359 deletions
|
@ -10,9 +10,8 @@ const app = express();
|
|||
const config = rcParser.getConfiguration();
|
||||
|
||||
app.locals.config = config;
|
||||
|
||||
// view engine setup
|
||||
app.set('views', path.join(__dirname, '../../src/backend/', 'views'));
|
||||
app.set('views', path.join(__dirname, './', 'views'));
|
||||
app.set('view engine', 'twig');
|
||||
require('./utils/twig');
|
||||
|
||||
|
@ -35,4 +34,4 @@ app.use(function (err: HttpException, req: Request, res: Response) {
|
|||
res.render('error');
|
||||
});
|
||||
|
||||
export default app;
|
||||
export default app;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import twig from 'twig';
|
||||
import fs from 'fs';
|
||||
import urlify from './urlify';
|
||||
import path from 'path';
|
||||
|
||||
export default (function () {
|
||||
'use strict';
|
||||
|
@ -16,7 +17,7 @@ export default (function () {
|
|||
* @returns {string} - svg code
|
||||
*/
|
||||
twig.extendFunction('svg', function (filename: string) {
|
||||
return fs.readFileSync(`./src/frontend/svg/${filename}.svg`, 'utf-8');
|
||||
return fs.readFileSync(path.join(__dirname, `./../../frontend/svg/${filename}.svg`), 'utf-8');
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue