-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow delegate access request property (#11)
> nodejs.TypeError: Cannot read private member #cookies from an object whose class did not declare it <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced two new Koa application files (`helloworld.cjs` and `helloworld.mjs`) that respond with a greeting message including the client's IP address. - **Bug Fixes** - Enhanced cookie handling in the `Context` class. - Updated visibility of certain properties in the `Request` class for better accessibility. - **Tests** - Added a new test case to verify the correct retrieval of the client's IP address in the Koa application. - **Chores** - Updated dependency versions and added type definitions in `package.json`. - Modified import statements in various files for improved clarity and organization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
138 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { Application } = require('../dist/commonjs/index.js'); | ||
|
||
const app = new Application(); | ||
|
||
// response | ||
app.use(ctx => { | ||
ctx.body = `Hello Koa, from ${ctx.ip}`; | ||
}); | ||
|
||
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Application } from '../dist/esm/index.js'; | ||
|
||
const app = new Application(); | ||
|
||
// response | ||
app.use(ctx => { | ||
ctx.body = `Hello Koa, from ${ctx.ip}`; | ||
}); | ||
|
||
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters