From d8b0d0d18edfef6a6320c01d6c8ba808ef218929 Mon Sep 17 00:00:00 2001 From: starsinmypockets Date: Mon, 17 Jun 2019 13:13:08 -0400 Subject: [PATCH 1/2] Add routes file to themes --- index.js | 1 + themes/eds/routes.js | 5 +++++ themes/example/routes.js | 3 +++ themes/opendk/routes.js | 3 +++ 4 files changed, 12 insertions(+) create mode 100644 themes/eds/routes.js create mode 100644 themes/example/routes.js create mode 100644 themes/opendk/routes.js diff --git a/index.js b/index.js index d2f670da..b45b0686 100644 --- a/index.js +++ b/index.js @@ -38,6 +38,7 @@ module.exports.makeApp = function () { const themeName = config.get('THEME') if (themeName) { app.use('/static', express.static(path.join(__dirname, `/${themeDir}/${themeName}/public`))) + require(`./${themeDir}/${themeName}/routes.js`)(app) } // Default assets app.use('/static', express.static(path.join(__dirname, '/public'))) diff --git a/themes/eds/routes.js b/themes/eds/routes.js new file mode 100644 index 00000000..5813e015 --- /dev/null +++ b/themes/eds/routes.js @@ -0,0 +1,5 @@ +module.exports = function (app) { + app.get('/mine', (req, res) => { + res.send('HELLO MINE') + }) +} diff --git a/themes/example/routes.js b/themes/example/routes.js new file mode 100644 index 00000000..1dd33381 --- /dev/null +++ b/themes/example/routes.js @@ -0,0 +1,3 @@ +module.exports = function (app) { + // Add custom routes and controller logic here +} diff --git a/themes/opendk/routes.js b/themes/opendk/routes.js new file mode 100644 index 00000000..1dd33381 --- /dev/null +++ b/themes/opendk/routes.js @@ -0,0 +1,3 @@ +module.exports = function (app) { + // Add custom routes and controller logic here +} From d024838bfbd42241e829ef5bf0c98f83bb4e8990 Mon Sep 17 00:00:00 2001 From: starsinmypockets Date: Mon, 17 Jun 2019 13:36:16 -0400 Subject: [PATCH 2/2] Remove test route --- themes/eds/routes.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/eds/routes.js b/themes/eds/routes.js index 5813e015..1dd33381 100644 --- a/themes/eds/routes.js +++ b/themes/eds/routes.js @@ -1,5 +1,3 @@ module.exports = function (app) { - app.get('/mine', (req, res) => { - res.send('HELLO MINE') - }) + // Add custom routes and controller logic here }