Skip to content

Commit

Permalink
fixed path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfroeller committed Apr 29, 2024
1 parent aa91c61 commit 3f9e94c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const babel = require('gulp-babel');
const paths = {
tscripts: { src: ['src/**/*.ts'], dest: 'build' },
jsscripts: { src: ['src/**/*.js'], dest: 'build' },
staticFiles: { src: ['src/templates/**/*'], dest: 'build/src/templates' },
staticAssets: { src: ['src/static/**/*'], dest: 'build/src/static' }
staticFiles: { src: ['src/templates/**/*'], dest: 'build/templates' },
staticAssets: { src: ['src/static/**/*'], dest: 'build/static' }
};

function defaultTask(cb) {
Expand Down
4 changes: 3 additions & 1 deletion src/assets.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const HyperExpress = require("hyper-express");
const assetRouter = new HyperExpress.Router();
const LiveDirectory = require("live-directory");
require('dotenv').config();

const LiveAssets = new LiveDirectory("./src/static/", {
const assetPath = process.env.DEV_MODE === "true" ? "./src/static/" : "./build/static/";
const LiveAssets = new LiveDirectory(assetPath, {
static: true,
filter: {
keep: {
Expand Down
4 changes: 3 additions & 1 deletion src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ const fs = require('node:fs');
const { JSDOM } = require('jsdom');
const herokuRouter = require('./v1/heroku');
const assetRouter = require('./assets');
require('dotenv').config();

const herokuRouteRoot = "/v1/heroku";
const homePage = fs.readFileSync('./src/templates/index.html', 'utf8');
const templatePath = process.env.DEV_MODE === "true" ? "./src/templates/index.html" : "./build/templates/index.html";
const homePage = fs.readFileSync(templatePath, 'utf8');
const routes = [...assetRouter.routes, {
routes: herokuRouter.routes,
rootPath: herokuRouteRoot
Expand Down

0 comments on commit 3f9e94c

Please sign in to comment.