Skip to content

Commit

Permalink
Fix some inline requires
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Apr 21, 2023
1 parent 4bbc400 commit 5a21e09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/routes/install-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import identifyRoute from '../middleware/identify-route-middleware';
import clientSideRoomAliasHashRedirectRoute from './client-side-room-alias-hash-redirect-route';
import redirectToCorrectArchiveUrlIfBadSigil from '../middleware/redirect-to-correct-archive-url-if-bad-sigil-middleware';

import roomDirectoryRoutes from './room-directory-routes';
import roomRoutes from './room-routes';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

function installRoutes(app) {
Expand Down Expand Up @@ -66,10 +69,10 @@ function installRoutes(app) {
app.use('/img', express.static(path.join(__dirname, '../../public/img')));
app.use('/js', express.static(path.join(__dirname, '../../dist/')));

app.use('/', require('./room-directory-routes'));
app.use('/', roomDirectoryRoutes);

// For room aliases (/r) or room ID's (/roomid)
app.use('/:entityDescriptor(r|roomid)/:roomIdOrAliasDirty', require('./room-routes'));
app.use('/:entityDescriptor(r|roomid)/:roomIdOrAliasDirty', roomRoutes);

// Since everything after the hash (`#`) won't make it to the server, let's serve a 404
// page that will potentially redirect them to the correct place if they tried
Expand Down

0 comments on commit 5a21e09

Please sign in to comment.