1
0
Fork 0
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:
Nikita Melnikov 2022-03-06 13:37:06 +04:00 committed by GitHub
parent 8d9c19e595
commit c6e2db0245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 167 additions and 2359 deletions

View file

@ -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;

View file

@ -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');
});
/**