mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
This reverts commit 67c31b69
This commit is contained in:
parent
e374a6248b
commit
844267ce25
3 changed files with 579 additions and 5 deletions
File diff suppressed because it is too large
Load diff
|
@ -3,6 +3,7 @@ import { Config } from '@verdaccio/types';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
import bodyParser from 'body-parser';
|
||||||
import whoami from './api/whoami';
|
import whoami from './api/whoami';
|
||||||
import ping from './api/ping';
|
import ping from './api/ping';
|
||||||
import user from './api/user';
|
import user from './api/user';
|
||||||
|
@ -41,6 +42,7 @@ export default function(config: Config, auth: IAuth, storage: IStorageHandler) {
|
||||||
app.param('anything', match(/.*/));
|
app.param('anything', match(/.*/));
|
||||||
|
|
||||||
app.use(auth.apiJWTmiddleware());
|
app.use(auth.apiJWTmiddleware());
|
||||||
|
app.use(bodyParser.json({ strict: false, limit: config.max_body_size || '10mb' }));
|
||||||
app.use(antiLoop(config));
|
app.use(antiLoop(config));
|
||||||
// encode / in a scoped package name to be matched as a single parameter in routes
|
// encode / in a scoped package name to be matched as a single parameter in routes
|
||||||
app.use(encodeScopePackage);
|
app.use(encodeScopePackage);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import express, { Application } from 'express';
|
import express, { Application } from 'express';
|
||||||
import bodyParser from 'body-parser';
|
|
||||||
import compression from 'compression';
|
import compression from 'compression';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import { HttpError } from 'http-errors';
|
import { HttpError } from 'http-errors';
|
||||||
|
@ -47,8 +46,6 @@ const defineAPI = function(config: IConfig, storage: IStorageHandler): any {
|
||||||
hookDebug(app, config.self_path);
|
hookDebug(app, config.self_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(bodyParser.json({ strict: false, limit: config.max_body_size || '10mb' }));
|
|
||||||
|
|
||||||
// register middleware plugins
|
// register middleware plugins
|
||||||
const plugin_params = {
|
const plugin_params = {
|
||||||
config: config,
|
config: config,
|
||||||
|
|
Loading…
Reference in a new issue