Skip to content

Commit

Permalink
Merge pull request #43 from 5jiji/restructure
Browse files Browse the repository at this point in the history
Fix frontend
  • Loading branch information
Naviary2 authored Jul 10, 2024
2 parents 3451f46 + 2dfb563 commit b60e216
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/server/middleware/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function configureMiddleware(app) {
app.use(cookieParser());

// Serve public assets. (e.g. css, scripts, images, audio. EXCLUDING htmls)
app.use(express.static(path.join(__dirname, '..', 'public'))); // Serve public assets
app.use(express.static(path.join(__dirname, '..', '..', '..', 'dist'))); // Serve public assets

/**
* Sets the req.user and req.role properties if they have an authorization
Expand Down
2 changes: 1 addition & 1 deletion src/server/middleware/send404.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
function send404(req, res) {
res.status(404);
if (req.accepts('html')) {
res.sendFile(path.join(__dirname, '..', 'views', 'errors', '404.html'));
res.sendFile(path.join(__dirname, '..', '..', '..', 'dist', 'views', 'errors', '404.html'));
} else if (req.accepts('json')) {
res.json({ error: "404 Not Found" });
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/server/routes/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { verifyAccount } = require('../controllers/verifyAccountController');
const { ensureOwner, ensurePatron } = require('../middleware/verifyRoles');
const { getCachedHTML, sendCachedHTML } = require('../utility/HTMLScriptInjector');

const htmlDirectory = path.join(__dirname, '..', 'dist', 'views');
const htmlDirectory = path.join(__dirname, '..', '..', '..', 'dist', 'views');

// router.get('/skeleton(.html)?', (req, res) => { // If it starts & ends with '/', OR it's '/index.html' OR '/index'
// res.sendFile(path.join(__dirname, '../views', 'skeleton.html'));
Expand Down

0 comments on commit b60e216

Please sign in to comment.