Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4444405
ephemeral_server.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
488 B
Referenced Files
None
Subscribers
None
ephemeral_server.js
View Options
let
count
=
0
;
const
MAX_REQUESTS
=
10
;
console
.
log
(
'starting on http://localhost:3000'
);
export
default
{
fetch
(
req
,
server
)
{
if
(
new
URL
(
req
.
url
).
pathname
.
includes
(
'favicon'
))
{
return
new
Response
(
null
,
{
status
:
404
});
}
count
++
;
if
(
count
===
MAX_REQUESTS
)
{
console
.
log
(
'10 requests served, stopping'
);
server
.
stop
();
}
return
Response
.
json
({
request
:
count
,
remaining
:
Math
.
max
(
0
,
MAX_REQUESTS
-
count
)
});
}
};
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 2, 10:17 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
539859
Default Alt Text
ephemeral_server.js (488 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment