3.1.2 • Published 3 years ago
@meteor-it/router v3.1.2
XPress
Websockets and others are moved to @meteor-it/xpress/support/*
To use them do:
import XPress from '@meteor-it/xpress';
import addWSSupport from '@meteor-it/xpress/support/ws';
const server=new XPress('name');
server.onListen(addWSSupport);
//... use as before!
Usage example:
import XPress,{Router} from '@meteor-it/xpress';
const server = new XPress('name');
server.on('GET /',async (req,res)=>{
res.redirect('/test/route');
});
server.on('GET /*',async (req,res,next)=>{
req.a=1;
next();
});
server.on('GET /**',async (req,res,next)=>{
req.b=2;
next();
});
server.on('ALL /t:c/*/*',async (req,res,next)=>{
// If url === /test/route/testing?a=12&a=33&c=42
// Custom defined strings
req.a; // = undefined
req.b; // = 2
// Extracted from path
req.params.c; // = est
req.params.star; // = route
req.params.star_2; // = testing
// Querystring parsing is also supported
req.query.a; // = [12,33]
req.query.c; // = 42
});
//Also express.js style handlers (Not for WS!):
server.get('/hello',async(req,res,next)=>{
res.status(201).send('123');
});
Now with HTTP2 support!
3.1.2
3 years ago
3.1.1
3 years ago
3.1.0
3 years ago
2.1.48
5 years ago
2.1.47
5 years ago
2.1.46
5 years ago
2.1.45
6 years ago
2.1.43
6 years ago
2.1.44
6 years ago
2.1.41
6 years ago
2.1.40
6 years ago
2.1.38
6 years ago
2.1.36
6 years ago
2.1.35
6 years ago
2.1.34
6 years ago
2.1.33
6 years ago
2.1.32
6 years ago
2.1.30
6 years ago
2.1.29
6 years ago
2.1.28
6 years ago
2.1.26
6 years ago
2.1.25
7 years ago
2.1.24
7 years ago
2.1.23
7 years ago
2.1.22
7 years ago
2.1.21
7 years ago
2.1.20
7 years ago
2.1.19
7 years ago
2.1.18
7 years ago
2.1.17
7 years ago
2.1.16
7 years ago
2.1.12
7 years ago
2.1.11
7 years ago
2.1.10
7 years ago
2.1.9
7 years ago
2.1.8
7 years ago
2.1.7
7 years ago
2.1.6
7 years ago
2.1.5
7 years ago
2.1.4
7 years ago
2.1.3
7 years ago
2.1.2
7 years ago
2.1.1
7 years ago
2.1.0
7 years ago
2.0.5
7 years ago
2.0.4
7 years ago
2.0.3
7 years ago