Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7539977
multi_server.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
586 B
Referenced Files
None
Subscribers
None
multi_server.cjs
View Options
// Example: Running multiple HTTP servers on different ports
function handler8000(req, res) {
return {
status: 200,
body: "Server on port 8000\nURI: " + req.uri
};
}
function handler8001(req, res) {
return {
status: 200,
body: "Server on port 8001\nURI: " + 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
Wed, Jun 17, 1:32 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
523152
Default Alt Text
multi_server.cjs (586 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment