Skip to content
This repository was archived by the owner on Aug 30, 2020. It is now read-only.

a7 Router

anton7r edited this page Sep 26, 2019 · 2 revisions

a7.routes

It's the router of a7JS and it is in it self pretty self explanatory. Essentially it takes a route / path / URL inside your app. And when it routes to a given url it will show the page that you attached to it.

The * (Star) Symbol

It is used to match URL where the starting bit until to the * is the same and anything after it. For example /users/* would be matched with /users/bob and /users/bob/likes

Syntax

a7.routes({
    "[route]": [component]()
})

Examples

/* index.js */
import a7 from "a7js";
import homePage from "./components/homePage";

a7.routes({
    "/home": homePage()
})
Clone this wiki locally