ostrio:flow-router-extra

v3.7.2Published 5 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Gitter GitHub issues GitHub forks GitHub stars Twitter

FlowRouter Extra

Carefully extended flow-router package.

Features:

Install

meteor add ostrio:flow-router-extra

ES6 Import

1import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
2// Full list of available classes and instances:
3// { FlowRouter, Router, Route, Group, Triggers, BlazeRenderer, RouterHelpers }

Usage

1import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
2
3FlowRouter.route('/', {
4  name: 'index',
5  action() {
6    // Render a template using Blaze
7    this.render('templateName');
8
9    // Can be used with BlazeLayout,
10    // and ReactLayout for React-based apps
11  }
12});
13
14// Create 404 route (catch-all)
15FlowRouter.route('*', {
16  action() {
17    // Show 404 error page using Blaze
18    this.render('notFound');
19
20    // Can be used with BlazeLayout,
21    // and ReactLayout for React-based apps
22  }
23});

Documentation

Running Tests

  1. Clone this package
  2. In Terminal (Console) go to directory where package is cloned
  3. Then run:

Meteor/Tinytest

# Default
meteor test-packages ./

# With custom port
meteor test-packages ./ --port 8888

# With local MongoDB and custom port
MONGO_URL="mongodb://127.0.0.1:27017/flow-router-tests" meteor test-packages ./ --port 8888

Support this project: