Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2918640
bench.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
590 B
Referenced Files
None
Subscribers
None
bench.js
View Options
import
{
createRouter
,
addRoute
,
findRoute
}
from
'./index.js'
;
const
router
=
createRouter
();
addRoute
(
router
,
'GET'
,
'/path'
,
{
payload
:
'this path'
});
addRoute
(
router
,
'POST'
,
'/path/:name'
,
{
payload
:
'named route'
});
addRoute
(
router
,
'GET'
,
'/path/foo/**'
,
{
payload
:
'wildcard route'
});
addRoute
(
router
,
'GET'
,
'/path/foo/**:name'
,
{
payload
:
'named wildcard route'
});
console
.
log
(
findRoute
(
router
,
'GET'
,
'/path'
));
console
.
log
(
findRoute
(
router
,
'POST'
,
'/path/fooval'
));
console
.
log
(
findRoute
(
router
,
'GET'
,
'/path/foo/bar/baz'
));
console
.
log
(
findRoute
(
router
,
'GET'
,
'/'
));
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Mar 27, 1:01 AM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
512169
Default Alt Text
bench.js (590 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment