Needs a little more testing before 1.0

This commit is contained in:
thosakwe 2016-10-13 05:52:56 -04:00
parent 5644b67caf
commit 051a253636

View file

@ -38,9 +38,10 @@ main() {
router.post('/users/:id/timeline', (String id) {}); router.post('/users/:id/timeline', (String id) {});
router.get('/square_root/:id([0-9]+)', (String id) { // Numbers automatically parsed
final n = num.parse(id);
return {'result': pow(n, 2) }; router.get('/square_root/:id([0-9]+)', (n) {
return { 'result': pow(n, 0.5) };
}); });
router.group('/show/:id', (router) { router.group('/show/:id', (router) {
@ -128,4 +129,4 @@ main() {
# Route Parameters # Route Parameters
Routes can have parameters, as seen in the above examples. Routes can have parameters, as seen in the above examples.
If a parameter is a numeber, then it will automatically be parsed. If a parameter is a number, then it will automatically be parsed.