You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aniket Prajapati edited this page Jun 11, 2020
·
1 revision
Follow these 2 simple steps to get your first FireJS site spinning.
Install
install using yarn or npm
yarn
$ yarn add @eadded/firejs react react-dom
npm
$ npm install @eadded/firejs react react-dom
Make A Page
Make dir src/pages in the project root. This dir will contain all the pages required for our brand-new hello world website.
Make a file 404.js in the dir. This file will be the 404 page of our website.
exportdefault()=>{return(<div><p>Welcome to 404</p></div>)}
Add the following script(s) to package.json
"scripts": {
"dev": "firejs",
}
Now run using yarn or npm
yarn
$ yarn run dev
npm
$ npm run dev
Navigate to http://localhost:5000 and there it says Welcome to 404.
To change server PORT set env variable PORT to the required value
But why 404 page?
You don't want anyone visiting your site to face a blank scary unknown page when they type in a wrong URL. So we made it mandatory to add a 404 page. Whenever you make a routing mistake FireJS will fallback to the 404 page.