Created
February 7, 2010 07:46
-
-
Save tim-smart/297297 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP({ | |
host: '127.0.0.1', | |
post: 8000, | |
routes: [{ | |
match: /^\/myroute/, | |
callback: function(request) {} | |
}, { | |
match: { | |
type: 'POST', | |
rule: /^\/myroute/ | |
}, | |
callback: function() {} | |
}, | |
['/myroute', function() {}], | |
['HEAD', '/myroute', function() {}], { | |
match: [{ | |
type: 'POST', | |
rule: [/^\/myroute/, '/myroute'] | |
}, { | |
rule: '/another' | |
}], | |
callback: function() {} | |
}], | |
callback: function() { | |
// Handle 404's etc in here | |
// If not specified, framework will | |
// Auto-generate error page | |
} | |
}); | |
// Same deal for other protocols | |
// This case raw tcp | |
TCP({ | |
... | |
}); | |
// Websocket etc etc | |
// Can define more protocols in plugins | |
WS({}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment