diff --git a/plugins/logger/index.js b/plugins/logger/index.js new file mode 100644 index 0000000..f35596c --- /dev/null +++ b/plugins/logger/index.js @@ -0,0 +1,15 @@ +/** + * Simple logging utility + */ +module.exports = { + native: true, + async exec(ctx, next){ + var start = process.hrtime(); + await next(); + var end = process.hrtime(start); + + end = (end[0] * 1000) + (end[1] / 10000); + + process.stdout.write("[" + ctx.request.method + "] " + ctx.status + " " + end + "ms " + ctx.request.path + "\n"); + } +} \ No newline at end of file diff --git a/plugins/logger/package.json b/plugins/logger/package.json new file mode 100644 index 0000000..1f4546b --- /dev/null +++ b/plugins/logger/package.json @@ -0,0 +1,3 @@ +{ + "main": "index.js" +} \ No newline at end of file diff --git a/plugins/php/package-lock.json b/plugins/php/package-lock.json deleted file mode 100644 index ca16ace..0000000 --- a/plugins/php/package-lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "php", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "fastcgi-client": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/fastcgi-client/-/fastcgi-client-0.0.1.tgz", - "integrity": "sha1-EEbUL/LO4qmsA/6gRpWz73MRhhw=" - } - } -} diff --git a/plugins/php/package.json b/plugins/php/package.json index cb42c5d..222dc65 100644 --- a/plugins/php/package.json +++ b/plugins/php/package.json @@ -10,6 +10,5 @@ "license": "ISC", "description": "", "dependencies": { - "fastcgi-client": "0.0.1" } }