Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/nnaji_example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
10 changes: 10 additions & 0 deletions examples/nnaji_example/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Home = () => {
// template logic

const view = `
<p> This is the Home page by Nnaji Chimuanya!</p>
`;
return view;
};

export default Home;
20 changes: 20 additions & 0 deletions examples/nnaji_example/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Router } from "yourrouter";
import Home from "./Home.js";

//congiguring the router

Router.createInstance({
path404: "/notFound",
// highlight-start

renderId: "#app", // use #app to id and .app to css class
});
const router = Router.getInstance();

//route to display the home page
router.addRoute("/", () => {
console.log("Hello, this is the home page");

// Returning a template which displays the homepage
return Home;
});
Loading