missing paths to views fixed
This commit is contained in:
1 parent
1d6772eef3
commit
1aef002781
3 files changed
+8
-3
No files matched your search
@@ -50,3 +50,6 @@ export const index = path.join(__dirname, indexFile);
|
|||||||
export const sitemapCacheTime = 600000;// 600 sec - cache purge period
|
export const sitemapCacheTime = 600000;// 600 sec - cache purge period
|
||||||
|
|
||||||
export const instagramToken = privateData['instagramToken'];
|
export const instagramToken = privateData['instagramToken'];
|
||||||
|
|
||||||
|
export const viewMain = path.join(__dirname, 'views/main.hbs')
|
||||||
|
export const view404 = path.join(__dirname, 'views/404.hbs')
|
||||||
+2
-1
@@ -11,6 +11,7 @@ const getPathWithNoTrailingSlash = require('../lib/url').getPathWithNoTrailingSl
|
|||||||
const {compose, any} = require('../lib/common')
|
const {compose, any} = require('../lib/common')
|
||||||
|
|
||||||
const menuModel = require('../models/menu').default
|
const menuModel = require('../models/menu').default
|
||||||
|
const config = require('../config')
|
||||||
|
|
||||||
async function getPage(path) {
|
async function getPage(path) {
|
||||||
return await c('pages').findOne({url: path})
|
return await c('pages').findOne({url: path})
|
||||||
@@ -59,7 +60,7 @@ module.exports = function () {
|
|||||||
const menu = buildMenu(path, menuModel)
|
const menu = buildMenu(path, menuModel)
|
||||||
const content = renderApp({menu, page})
|
const content = renderApp({menu, page})
|
||||||
|
|
||||||
const source = await readFile('src/views/main.hbs', 'utf-8')
|
const source = await readFile(config.viewMain, 'utf-8')
|
||||||
const template = handlebars.compile(source)
|
const template = handlebars.compile(source)
|
||||||
|
|
||||||
ctx.type = 'text/html'
|
ctx.type = 'text/html'
|
||||||
|
|||||||
+3
-2
@@ -13,12 +13,13 @@ import cookie from 'koa-cookie'
|
|||||||
import bodyParser from 'koa-bodyparser'
|
import bodyParser from 'koa-bodyparser'
|
||||||
|
|
||||||
import apiV1 from 'hudozka-api-v1'
|
import apiV1 from 'hudozka-api-v1'
|
||||||
import config, {redirectionTable} from './config'
|
import {redirectionTable} from './config'
|
||||||
import {routes, queryObject} from './routes'
|
import {routes, queryObject} from './routes'
|
||||||
import {redirect} from './routes/redirect'
|
import {redirect} from './routes/redirect'
|
||||||
import {services as serviceKeys, authChecker} from './core/service'
|
import {services as serviceKeys, authChecker} from './core/service'
|
||||||
import handlebars from 'handlebars'
|
import handlebars from 'handlebars'
|
||||||
|
|
||||||
|
const config = require('./config')
|
||||||
const error = require('./middlewares/error')
|
const error = require('./middlewares/error')
|
||||||
|
|
||||||
const dirPublic = path.join(__dirname, '../public')
|
const dirPublic = path.join(__dirname, '../public')
|
||||||
@@ -50,7 +51,7 @@ export default function (store) {
|
|||||||
app.use($(helmet()))
|
app.use($(helmet()))
|
||||||
app.use(queryObject())
|
app.use(queryObject())
|
||||||
|
|
||||||
app.use(error.notFound('src/views/404.hbs'))
|
app.use(error.notFound(config.view404))
|
||||||
app.use(routes(store))
|
app.use(routes(store))
|
||||||
|
|
||||||
return Server(app.callback())
|
return Server(app.callback())
|
||||||
|
|||||||
Reference in new issue
Block a user