parent
e92e6e78b7
commit
e36cc37719
|
@ -0,0 +1,10 @@
|
||||||
|
jsxBracketSameLine: true
|
||||||
|
jsxSingleQuote: true
|
||||||
|
semi: false
|
||||||
|
singleQuote: true
|
||||||
|
printWidth: 100
|
||||||
|
useTabs: false
|
||||||
|
tabWidth: 2
|
||||||
|
trailingComma: none
|
||||||
|
bracketSpacing: true
|
||||||
|
arrowParens: avoid
|
6
index.js
6
index.js
|
@ -142,7 +142,7 @@ export default class Five {
|
||||||
|
|
||||||
this.__main__()
|
this.__main__()
|
||||||
|
|
||||||
server = http.createServer(function(req, res) {
|
server = http.createServer(function (req, res) {
|
||||||
var request = new Request(req, res)
|
var request = new Request(req, res)
|
||||||
var response = new Response(req, res)
|
var response = new Response(req, res)
|
||||||
|
|
||||||
|
@ -153,11 +153,11 @@ export default class Five {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
response.set('X-Powered-By', 'Five.js')
|
response.set('X-Powered-By', this.get('X-Powered-By') || 'Five.js')
|
||||||
|
|
||||||
if (fn) {
|
if (fn) {
|
||||||
;(async function next() {
|
;(async function next() {
|
||||||
await fn.call(_this, request, response, function() {
|
await fn.call(_this, request, response, function () {
|
||||||
fn = middleware.shift()
|
fn = middleware.shift()
|
||||||
if (fn) {
|
if (fn) {
|
||||||
next()
|
next()
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import url from 'url'
|
import url from 'url'
|
||||||
|
|
||||||
export default function(req, res, next) {
|
export default function (req, res, next) {
|
||||||
var CORS = this.get('cors')
|
var CORS = this.get('cors')
|
||||||
|
|
||||||
if (CORS.enabled) {
|
if (CORS.enabled) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@gm5/core",
|
"name": "@gm5/core",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手",
|
"description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手",
|
||||||
"author": "yutent <yutent.io@gmail.com>",
|
"author": "yutent <yutent.io@gmail.com>",
|
||||||
|
@ -21,7 +21,9 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/bytedo/gmf.core.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": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue