Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4497705
multi_server.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
520 B
Referenced Files
None
Subscribers
None
multi_server.cjs
View Options
// Example: Running multiple HTTP servers on different ports
function handler8000(c) {
c.res.body("Server on port 8000\nURI: " + c.req.uri);
}
function handler8001(c) {
c.res.body("Server on port 8001\nURI: " + c.req.uri);
}
console.log("Starting multiple HTTP servers...");
// Note: Currently Ant.serve() is blocking, so you can only run one server
// In the future, we could make it non-blocking to support truly concurrent servers
console.log("Starting server on port 8000...");
Ant.serve(8000, handler8000);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 7:21 AM (5 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
518723
Default Alt Text
multi_server.cjs (520 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment