Remove _metadata and _module routes

See #185
This commit is contained in:
Michael Jackson 2019-05-18 21:43:48 -07:00
parent bc69d086f7
commit bade9a8d28
3 changed files with 2 additions and 36 deletions

View File

@ -7,7 +7,6 @@ import serveStaticFile from './serveStaticFile';
* Send the file, JSON metadata, or HTML directory listing.
*/
export default function serveFile(req, res) {
// Deprecated.
if (req.query.meta != null) {
return serveMetadata(req, res);
}
@ -16,7 +15,6 @@ export default function serveFile(req, res) {
return serveAutoIndexPage(req, res);
}
// Deprecated.
if (req.query.module != null) {
return serveModule(req, res);
}

View File

@ -2,8 +2,8 @@ import createSearch from '../utils/createSearch';
const knownQueryParams = {
main: true, // Deprecated, see #63
meta: true, // Deprecated
module: true // Deprecated
meta: true,
module: true
};
function isKnownQueryParam(param) {

View File

@ -3,8 +3,6 @@ import express from 'express';
// import serveAuth from './actions/serveAuth';
import serveFile from './actions/serveFile';
import serveMainPage from './actions/serveMainPage';
import serveMetadata from './actions/serveMetadata';
import serveModule from './actions/serveModule';
import servePublicKey from './actions/servePublicKey';
import serveStats from './actions/serveStats';
@ -51,36 +49,6 @@ app.use(
})
);
app.use(
'/_metadata',
createRouter(app => {
app.get(
'*',
validatePackageURL,
validatePackageName,
validateQuery,
fetchPackage,
findFile,
serveMetadata
);
})
);
app.use(
'/_module',
createRouter(app => {
app.get(
'*',
validatePackageURL,
validatePackageName,
validateQuery,
fetchPackage,
findFile,
serveModule
);
})
);
app.get(
'*',
validatePackageURL,