diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..c0e277f --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,10 @@ +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 100 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true +arrowParens: avoid \ No newline at end of file diff --git a/index.js b/index.js index 43235b7..ee67649 100644 --- a/index.js +++ b/index.js @@ -142,7 +142,7 @@ export default class Five { this.__main__() - server = http.createServer(function(req, res) { + server = http.createServer(function (req, res) { var request = new Request(req, res) var response = new Response(req, res) @@ -153,11 +153,11 @@ export default class Five { return } - response.set('X-Powered-By', 'Five.js') + response.set('X-Powered-By', this.get('X-Powered-By') || 'Five.js') if (fn) { ;(async function next() { - await fn.call(_this, request, response, function() { + await fn.call(_this, request, response, function () { fn = middleware.shift() if (fn) { next() diff --git a/middleware/cors.js b/middleware/cors.js index fb25d87..c4dc3c5 100644 --- a/middleware/cors.js +++ b/middleware/cors.js @@ -6,7 +6,7 @@ import url from 'url' -export default function(req, res, next) { +export default function (req, res, next) { var CORS = this.get('cors') if (CORS.enabled) { diff --git a/package.json b/package.json index f7e65f5..c273a67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gm5/core", - "version": "1.0.5", + "version": "1.0.6", "type": "module", "description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手", "author": "yutent ", @@ -21,7 +21,9 @@ "type": "git", "url": "https://github.com/bytedo/gmf.core.git" }, - "keywords": ["five, fivejs, node-five, five.js, nodejs, mvc, koa, express"], + "keywords": [ + "five, fivejs, node-five, five.js, nodejs, mvc, koa, express" + ], "engines": { "node": ">=10.0.0" },