Skip to content

Commit

Permalink
refactor: upgrade deps + refactor code to be with oop class style + s…
Browse files Browse the repository at this point in the history
…upport node.js 20+ ...etc
  • Loading branch information
3imed-jaberi committed Aug 15, 2024
1 parent 31deae8 commit ab8a4be
Show file tree
Hide file tree
Showing 10 changed files with 2,709 additions and 3,089 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ jobs:
os:
- ubuntu-latest
node_version:
- 14
- 16
- 18
- 20
- 22
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .xo-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
'unicorn/explicit-length-check': 'warn',
'unicorn/no-array-reduce': 'warn',
'unicorn/prefer-spread': 'warn',
'unicorn/prefer-node-protocol': 'off'
'unicorn/prefer-node-protocol': 'off',
'unicorn/expiring-todo-comments': 'off',
'max-nested-callbacks': 'off'
}
};
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ See [API Reference](./API.md) for more documentation.
| ---------------- |
| **Alex Mingoia** |
| **@koajs** |
| **Imed Jaberi** |


## License
Expand Down
11 changes: 8 additions & 3 deletions bench/server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const Koa = require('koa');
const Router = require('../');
const process = require('node:process');
const env = require('@ladjs/env')({
path: '../.env',
includeProcessEnv: true,
assignToProcessEnv: true
});
const Koa = require('koa');

const Router = require('../');

const app = new Koa();
const router = new Router();

const ok = (ctx) => (ctx.status = 200);
const ok = (ctx) => {
ctx.status = 200;
};

const n = Number.parseInt(env.FACTOR || '10', 10);
const useMiddleware = env.USE_MIDDLEWARE === 'true';

Expand Down
Loading

0 comments on commit ab8a4be

Please sign in to comment.