Add the static assets directory and serve it.

This commit is contained in:
Dave Smith-Hayes 2024-07-31 20:42:17 -04:00
parent 57620a2404
commit c035bfec8a
2 changed files with 6 additions and 3 deletions

View File

@ -1,2 +0,0 @@
/* Do something */

View File

@ -29,7 +29,12 @@ app.get(
) )
); );
app.get('/static/*', serveStatic({ root: "./assets/" })); app.use('/static/*', serveStatic({
root: '/src/assets',
onNotFound: (path, c) => {
console.error(`${path} is not found; Trying to access ${c.req.path}`);
}
}));
console.log(JSON.stringify({ message: "Bootstrapping the routes..." })); console.log(JSON.stringify({ message: "Bootstrapping the routes..." }));
app.route('/', home); app.route('/', home);