mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
Reverting changes made to get things to compile on an earlier master branch
This commit is contained in:
@@ -54,7 +54,7 @@ export function createResultWriter(response: express.Response, params: ResultWri
|
||||
|
||||
function mapQuery(app: express.Express, queryName: string, queryDefinition: QueryDefinition) {
|
||||
function createJob(queryParams: any, req: express.Request, res: express.Response) {
|
||||
const entryId = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const entryId = req.params.id;
|
||||
const commonParams = normalizeRestCommonParams(req.query);
|
||||
const resultWriterParams = { encoding: commonParams.encoding!, download: !!commonParams.download, filename: commonParams.filename!, entryId, queryName };
|
||||
const jobId = JobManager.add({
|
||||
@@ -93,9 +93,7 @@ function serveStatic(req: express.Request, res: express.Response) {
|
||||
: req.params.source;
|
||||
|
||||
const id = req.params.id;
|
||||
const stringSource = (Array.isArray(source) ? source[0] : source) || '';
|
||||
const stringId = (Array.isArray(id) ? id[0] : id) || '';
|
||||
const [fn, format] = mapSourceAndIdToFilename(stringSource, stringId);
|
||||
const [fn, format] = mapSourceAndIdToFilename(source, id);
|
||||
const binary = format === 'bcif' || fn.indexOf('.bcif') > 0;
|
||||
|
||||
if (!fn || !fs.existsSync(fn)) {
|
||||
|
||||
@@ -105,7 +105,7 @@ function mapPath(path: string) {
|
||||
}
|
||||
|
||||
app.get(mapPath(`/get/:id`), (req, res) => {
|
||||
const id = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const id: string = req.params.id || '';
|
||||
console.log('Reading', id);
|
||||
if (id.length === 0 || id.indexOf('.') >= 0 || id.indexOf('/') >= 0 || id.indexOf('\\') >= 0) {
|
||||
res.status(404);
|
||||
|
||||
@@ -183,9 +183,7 @@ async function queryBox(req: express.Request, res: express.Response, params: Dat
|
||||
return;
|
||||
}
|
||||
|
||||
const stringSource = (Array.isArray(req.params.source) ? req.params.source[0] : req.params.source) || '';
|
||||
const stringId = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const outputFilename = Api.getOutputFilename(stringSource, stringId, params);
|
||||
const outputFilename = Api.getOutputFilename(req.params.source, req.params.id, params);
|
||||
const response = wrapResponse(outputFilename, res);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user