Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Create routes for pages in Vanilla.js app #221

Merged
merged 15 commits into from
Oct 8, 2024
Merged

Create routes for pages in Vanilla.js app #221

merged 15 commits into from
Oct 8, 2024

Conversation

29deepanshutyagi
Copy link
Contributor

This pull request implements a basic routing system for our Vanilla.js Decentralized Web App (DWA) starter. The following features have been added:

Vanilla Router:
    Set up a simple client-side router using the History API to manage navigation between different pages without full page reloads.

Defined Routes:
    Created routes for the following pages:
        / (Home page) - Renders the word "Home"
        /about - Renders the word "About"
        /settings - Renders the word "Settings"
    Implemented a 404 error handling for undefined routes, rendering a "404 - Page Not Found" message.

Navigation Menu:
    Added a navigation menu that allows users to switch between the defined routes seamlessly.

Automated Tests:
    Implemented Playwright tests to verify routing functionality:
        Ensured the correct word is displayed for each defined route.
        Verified that the 404 page is shown for undefined routes.

Changes Made:

Created a routing system in main.js.
Added component functions for Home, About, and Settings pages in components.js.
Developed a simple navigation menu in index.html.
Wrote Playwright tests in the tests/router.spec.js file.

Testing:

Run the application locally to ensure navigation works without console errors.
Execute Playwright tests to confirm routing functionality and proper handling of undefined routes.



issue #83

Copy link
Contributor

@blackgirlbytes blackgirlbytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good! Thanks for the contribution

@blackgirlbytes blackgirlbytes merged commit 9716a7a into TBD54566975:main Oct 8, 2024
21 checks passed
@blackgirlbytes blackgirlbytes linked an issue Oct 9, 2024 that may be closed by this pull request
10 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create routes for pages in Vanilla.js app
2 participants