-
Notifications
You must be signed in to change notification settings - Fork 0
feat: switch to a more complete routing engine find-my-way #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
07d02af
fix: lambda function urls do not decode rawPath
blacha 025f711
feat: switch to a more complete routing engine find-my-way
blacha ed6239f
wip: test cloudfront with rainbows
blacha a233828
refactor: cleanup types
blacha 222b1df
refactor: remove commented out code
blacha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
| import o from 'ospec'; | ||
| import { RequestTypes } from '../../__test__/examples.js'; | ||
| import { LambdaHttpRequest } from '../request.http.js'; | ||
| import { LambdaHttpResponse } from '../response.http.js'; | ||
| import { Router } from '../router.js'; | ||
|
|
||
| o.spec('Router', () => { | ||
| const router = new Router(); | ||
| router.get('/v1/🦄/🌈/:fileName', (req: LambdaHttpRequest<{ Params: { fileName: string } }>) => { | ||
| return LambdaHttpResponse.ok().json({ | ||
| fileName: req.params.fileName, | ||
| path: req.path, | ||
| query: [...req.query.entries()], | ||
| }); | ||
| }); | ||
| const expectedResult = { fileName: '🦄.json', path: encodeURI('/v1/🦄/🌈/🦄.json'), query: [['🌈', '🦄']] }; | ||
|
|
||
| for (const rt of RequestTypes) { | ||
| o.spec(rt.type, () => { | ||
| o(`should route rainbows and unicorns`, async () => { | ||
| const urlRoute = rt.create('/v1/🦄/🌈/🦄.json', '🌈=🦄'); | ||
| const res = await router.handle(urlRoute); | ||
| o(res.status).equals(200); | ||
| o(res.body).deepEquals(JSON.stringify(expectedResult)); | ||
| }); | ||
|
|
||
| o('path should be url encoded', () => { | ||
| const req = rt.create('/v1/🦄/🌈/🦄.json', ''); | ||
| o(req.path).equals('/v1/%F0%9F%A6%84/%F0%9F%8C%88/%F0%9F%A6%84.json'); | ||
| }); | ||
|
|
||
| o('should 404 on invalid routes', async () => { | ||
| const res = await router.handle(rt.create('/v1/🦄/🦄/🦄.json', '🌈=🦄')); | ||
| o(res.status).equals(404); | ||
| }); | ||
| }); | ||
| } | ||
| }); |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.