Use express.Router directly
This commit is contained in:
parent
b44670d0bd
commit
83cb7af8b0
|
@ -4,9 +4,7 @@ import cors from 'cors';
|
|||
import userToken from '../middleware/userToken';
|
||||
import showAuth from '../actions/showAuth';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.disable('x-powered-by');
|
||||
const app = express.Router();
|
||||
|
||||
app.use(cors());
|
||||
app.use(userToken);
|
||||
|
|
|
@ -2,9 +2,8 @@ import express from 'express';
|
|||
|
||||
import serveMainPage from '../actions/serveMainPage';
|
||||
|
||||
const app = express();
|
||||
const app = express.Router();
|
||||
|
||||
app.disable('x-powered-by');
|
||||
app.use(serveMainPage);
|
||||
|
||||
export default app;
|
||||
|
|
|
@ -10,9 +10,7 @@ import validatePackageName from '../middleware/validatePackageName';
|
|||
import validateQuery from '../middleware/validateQuery';
|
||||
import serveFile from '../actions/serveFile';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.disable('x-powered-by');
|
||||
const app = express.Router();
|
||||
|
||||
app.use(cors());
|
||||
app.use(redirectLegacyURLs);
|
||||
|
|
|
@ -3,9 +3,7 @@ import cors from 'cors';
|
|||
|
||||
import showPublicKey from '../actions/showPublicKey';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.disable('x-powered-by');
|
||||
const app = express.Router();
|
||||
|
||||
app.use(cors());
|
||||
app.use(showPublicKey);
|
||||
|
|
|
@ -3,9 +3,7 @@ import cors from 'cors';
|
|||
|
||||
import showStats from '../actions/showStats';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.disable('x-powered-by');
|
||||
const app = express.Router();
|
||||
|
||||
app.use(cors());
|
||||
app.use(showStats);
|
||||
|
|
Loading…
Reference in New Issue