v1
宇天 2020-09-26 22:36:26 +08:00
parent d802e1cd39
commit 6aca3e2695
1 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ function hideProperty(host, name, value) {
value: value, value: value,
writable: true, writable: true,
enumerable: false, enumerable: false,
configurable: true configurable: true,
}) })
} }
@ -116,7 +116,7 @@ export default class Five {
var list = fs.ls(dir) var list = fs.ls(dir)
if (list) { if (list) {
list.forEach(item => { list.forEach((item) => {
var { name } = path.parse(item) var { name } = path.parse(item)
if (name.startsWith('.')) { if (name.startsWith('.')) {
return return
@ -127,7 +127,7 @@ export default class Five {
item = path.join(item, './index.js') item = path.join(item, './index.js')
} }
this.__MODULES__[name] = import(item).catch(err => { this.__MODULES__[name] = import(item).catch((err) => {
return { default: null } return { default: null }
}) })
}) })
@ -143,7 +143,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)
@ -158,7 +158,7 @@ export default class Five {
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()