Skip to content

Commit

Permalink
fix: correctly serve otherData directory
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jan 16, 2024
1 parent fba1e33 commit e5c90ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import passport from "passport";
import { fileURLToPath } from "url";
import { createClient } from "redis";

import { REDIS_CONNECTION, MERGED_TRACKS_DIR, SESSION_SECRET, PORTAL_ORIGIN } from "./envConfig.js";
import { REDIS_CONNECTION, MERGED_TRACKS_DIR, OTHER_DATA_PATH, SESSION_SECRET, PORTAL_ORIGIN } from "./envConfig.js";

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

Expand Down Expand Up @@ -80,7 +80,7 @@ app.use('/api/ucsc', (await import('./routes/ucsc.mjs')).default);
// - merged tracks
app.use('/api/merged', express.static(MERGED_TRACKS_DIR));
// - other data
app.use('/api/otherData', express.static(MERGED_TRACKS_DIR));
app.use('/api/otherData', express.static(OTHER_DATA_PATH));

// catch 404 and forward to error handler
app.use((req, res, next) => {
Expand Down
4 changes: 4 additions & 0 deletions envConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const ABOUT_MD_PATH = path.join(DATA_DIR, "about.md");
// - Static tracks to put in UCSC track hub.
const STATIC_TRACKS_PATH = path.join(DATA_DIR, "ucsc.other-tracks.txt");

// - Other tracks data (legend tracks)
const OTHER_DATA_PATH = path.join(DATA_DIR, "./otherData");

// - Track metadata for the dataset this node hosts
const TRACK_METADATA_PATH = getPrefixedEnvVar("TRACK_METADATA_PATH", path.join(DATA_DIR, "metadata.json"));

Expand Down Expand Up @@ -103,6 +106,7 @@ module.exports = {
DATA_DIR,
ABOUT_MD_PATH,
STATIC_TRACKS_PATH,
OTHER_DATA_PATH,
TRACK_METADATA_PATH,
INPUT_FILES_DIR,
TRACKS_DIR,
Expand Down

0 comments on commit e5c90ef

Please sign in to comment.