Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4449068
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
Sat, May 2, 12:08 PM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
518038
Default Alt Text
bench.js (590 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment