Wrap app.any
This commit is contained in:
parent
fd11df1134
commit
8da1edc516
@ -7,6 +7,8 @@ const app = uWS./*SSL*/App({
|
|||||||
key_file_name: 'misc/key.pem',
|
key_file_name: 'misc/key.pem',
|
||||||
cert_file_name: 'misc/cert.pem',
|
cert_file_name: 'misc/cert.pem',
|
||||||
passphrase: '1234'
|
passphrase: '1234'
|
||||||
|
}).any('/anything', (res, req) => {
|
||||||
|
res.end('Any route with method: ' + req.getMethod());
|
||||||
}).get('/user/agent', (res, req) => {
|
}).get('/user/agent', (res, req) => {
|
||||||
/* Read headers */
|
/* Read headers */
|
||||||
res.end('Your user agent is: ' + req.getHeader('user-agent') + ' thank you, come again!');
|
res.end('Your user agent is: ' + req.getHeader('user-agent') + ' thank you, come again!');
|
||||||
|
@ -287,7 +287,10 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
|
|||||||
uWS_App_get<APP>(&APP::trace, args);
|
uWS_App_get<APP>(&APP::trace, args);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/* What about unhandled? */
|
/* Any http method */
|
||||||
|
appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "any"), FunctionTemplate::New(isolate, [](auto &args) {
|
||||||
|
uWS_App_get<APP>(&APP::any, args);
|
||||||
|
}));
|
||||||
|
|
||||||
/* ws, listen */
|
/* ws, listen */
|
||||||
appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "ws"), FunctionTemplate::New(isolate, uWS_App_ws<APP>));
|
appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "ws"), FunctionTemplate::New(isolate, uWS_App_ws<APP>));
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 98d329c91241ffaa3be90740f5b3afc1608ded97
|
Subproject commit 9829f7fb37c129ac4945cfd58355959270d73d8f
|
Loading…
Reference in New Issue
Block a user