diff --git a/src/utils/createCommonPath.js b/src/utils/createCommonPath.js index 0d571f3..7ca0b2c 100644 --- a/src/utils/createCommonPath.js +++ b/src/utils/createCommonPath.js @@ -3,7 +3,7 @@ const appDir = dirname(require.main.filename); const fs = require('fs') const langs = ["es", "en"] -function createCommonPath(router, path, renderParams = { +async function createCommonPath(router, path, renderParams = { }, cb = () => {}){ const defaultParams = { view: path, @@ -30,11 +30,13 @@ function createCommonPath(router, path, renderParams = { } } renderOptions.lang = "es" - createPath('/' + path, cb, renderOptions, router) - langs.forEach(l => { - renderOptions.lang = l - createPath('/' + l + "/" + path, cb, renderOptions, router) - }) + renderOptions.langPath = "" + await createPath('/' + path, cb, renderOptions, router) + // for(let l in langs){ + // renderOptions.lang = l + // renderOptions.langPath = l + '/' + // await createPath('/' + renderOptions.langPath + path, cb, renderOptions, router) + // } } async function createPath(path, cb, renderOptions, router){ diff --git a/views/home.hbs b/views/home.hbs index 396df83..3d14ae1 100644 --- a/views/home.hbs +++ b/views/home.hbs @@ -2,7 +2,7 @@