Skip to content

Commit

Permalink
use custom assets dir if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Feb 23, 2024
1 parent 2890077 commit dab0613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions source/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export default async function createServer(config = defaultConfig) :Promise<expr
});
});


if(config.assets_dir){
app.use("/dist", express.static(config.assets_dir));
}

/* istanbul ignore next */
if(config.hot_reload){
console.log("Hot reload enabled");
Expand Down
2 changes: 1 addition & 1 deletion source/server/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const values = {
templates_dir: [path.join(process.cwd(),"templates"), toPath],
files_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"files"), toPath],
dist_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"dist"), toPath],
assets_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"assets"), toPath],
assets_dir: [undefined, toPath],
trust_proxy: [true, toBool],
hostname: [hostname(), toString],
hot_reload:[false, toBool],
Expand Down

0 comments on commit dab0613

Please sign in to comment.