Skip to content

Tried to recreate how does NextJS' page router system works under the hood, for HTML

Notifications You must be signed in to change notification settings

bedantH/page-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

One of the major features of NextJs, is its page-routing tech that developers love. NextJS eliminates a lot of overhead that developers had to explicitly perform for proper page routing. I have been using NextJS for about 2 years now, so I tried to replicate this feature for Vanilla HTML websites.

How to use it ?

Just clone this repo, and run yarn dev on your terminal and go to http://localhost:3000/ there you can see how you can add pages and get them routed.

Todos:

1. Its working fine, however if a new page(.html file) is added you will have to restart the server, will be fixing this in the next commit.
2. Handling more complex directory structures.
3. Support for dynamic pages.

image

About

Tried to recreate how does NextJS' page router system works under the hood, for HTML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published