Remove auto-index function
This commit is contained in:
parent
faa1eeae8f
commit
9cd9fb1f9b
|
@ -7,7 +7,6 @@
|
||||||
{ "source": "/api/public-key", "function": "servePublicKey" },
|
{ "source": "/api/public-key", "function": "servePublicKey" },
|
||||||
{ "source": "/api/stats", "function": "serveStats" },
|
{ "source": "/api/stats", "function": "serveStats" },
|
||||||
{ "source": "/", "function": "serveMainPage" },
|
{ "source": "/", "function": "serveMainPage" },
|
||||||
{ "source": "**/", "function": "serveAutoIndexPage" },
|
|
||||||
{ "source": "**", "function": "serveNpmPackageFile" }
|
{ "source": "**", "function": "serveNpmPackageFile" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { https } from 'firebase-functions';
|
import { https } from 'firebase-functions';
|
||||||
|
|
||||||
// import serveAuth from './serveAuth';
|
// import serveAuth from './serveAuth';
|
||||||
import serveAutoIndexPage from './serveAutoIndexPage';
|
|
||||||
import serveMainPage from './serveMainPage';
|
import serveMainPage from './serveMainPage';
|
||||||
import serveNpmPackageFile from './serveNpmPackageFile';
|
import serveNpmPackageFile from './serveNpmPackageFile';
|
||||||
import servePublicKey from './servePublicKey';
|
import servePublicKey from './servePublicKey';
|
||||||
|
@ -9,7 +8,6 @@ import serveStats from './serveStats';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// serveAuth: https.onRequest(serveAuth),
|
// serveAuth: https.onRequest(serveAuth),
|
||||||
serveAutoIndexPage: https.onRequest(serveAutoIndexPage),
|
|
||||||
serveMainPage: https.onRequest(serveMainPage),
|
serveMainPage: https.onRequest(serveMainPage),
|
||||||
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
|
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
|
||||||
servePublicKey: https.onRequest(servePublicKey),
|
servePublicKey: https.onRequest(servePublicKey),
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
import express from 'express';
|
|
||||||
import cors from 'cors';
|
|
||||||
|
|
||||||
// import checkBlacklist from '../middleware/checkBlacklist';
|
|
||||||
import fetchPackage from '../middleware/fetchPackage';
|
|
||||||
import findFile from '../middleware/findFile';
|
|
||||||
import redirectLegacyURLs from '../middleware/redirectLegacyURLs';
|
|
||||||
import validatePackageURL from '../middleware/validatePackageURL';
|
|
||||||
import validatePackageName from '../middleware/validatePackageName';
|
|
||||||
import validateQuery from '../middleware/validateQuery';
|
|
||||||
import serveAutoIndexPage from '../actions/serveAutoIndexPage';
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
|
||||||
|
|
||||||
app.use(cors());
|
|
||||||
app.use(redirectLegacyURLs);
|
|
||||||
app.use(validatePackageURL);
|
|
||||||
app.use(validatePackageName);
|
|
||||||
app.use(validateQuery);
|
|
||||||
// app.use(checkBlacklist);
|
|
||||||
app.use(fetchPackage);
|
|
||||||
app.use(findFile);
|
|
||||||
app.use(serveAutoIndexPage);
|
|
||||||
|
|
||||||
export default app;
|
|
|
@ -87,7 +87,6 @@ const functions = [
|
||||||
].concat(
|
].concat(
|
||||||
[
|
[
|
||||||
// 'serveAuth',
|
// 'serveAuth',
|
||||||
'serveAutoIndexPage',
|
|
||||||
'serveMainPage',
|
'serveMainPage',
|
||||||
'serveNpmPackageFile',
|
'serveNpmPackageFile',
|
||||||
'servePublicKey',
|
'servePublicKey',
|
||||||
|
|
Loading…
Reference in New Issue