Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Quick Start

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.

export default () => {  
  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.

🏡 Home

Getting Started
Advance
Tips and Tricks

🗒️ All examples in this documentation are written in typescript

Clone this wiki locally