Skip to content

Commit

Permalink
fix(sys server): fix body limit 413;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Sep 26, 2021
1 parent 4dec08b commit 488fc9e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/system-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-07-30 10:30:29
* @LastEditTime: 2021-09-09 00:53:24
* @LastEditTime: 2021-09-26 16:59:56
* @Description:
*/

Expand All @@ -14,7 +14,9 @@ import { logger } from './lib/logger'
import { createSystemCollectionIndexes } from './api/init'

const server = express()
server.use(express.json() as any)
server.use(express.json({
limit: '10000kb'
}) as any)

createSystemCollectionIndexes()
.then(() => {
Expand All @@ -25,9 +27,6 @@ createSystemCollectionIndexes()
* Allow CORS by default
*/
server.all('*', function (_req, res, next) {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Headers', 'Authorization, Content-Type')
res.header('Access-Control-Allow-Methods', '*')
res.header('X-Powered-By', 'LaF Server')
next()
})
Expand Down

0 comments on commit 488fc9e

Please sign in to comment.