-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
51 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
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 |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { Elysia } from '../src' | ||
import { Elysia, error, t } from '../src' | ||
|
||
const child = new Elysia() | ||
// ? This is only in local | ||
.derive(() => ({ | ||
hello: 'world' | ||
})) | ||
/** | ||
* ? Since hello is only in local | ||
* ? It might not be available in global | ||
* | ||
**/ | ||
.mapDerive(({ hello }) => ({ | ||
hello | ||
})) | ||
.get('/child', ({ hello }) => hello) | ||
const app = new Elysia({ precompile: true }) | ||
.headers({ | ||
a: 'hello' | ||
}) | ||
.get('/', 'a') | ||
.listen(3000) | ||
|
||
console.log(app.routes[0].composed?.toString()) |
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