in

React template with SSR by using Firebase Cloud Functions


react-firebase-ssr

React template with SSR by using Firebase Cloud Functions.

Seel the deference bellow

Pre-requisites

Make sure you have [firebase-tools][firebase-tools] installed

Install all dependencies

npm i
cd functions/ 
npm i

Get Starter

npm start will start webpack-dev-server on port 7003

Run with firebase server

Build the app to generate client.html

rm -rf public && PUBLIC_PATH=http://0.0.0.0:5000 npmR build -- --watch

PUBLIC_PATH is the hosting URL generated by firebase server

Inside functions folder, run webpack in watch mode

rm -rf dist/ && npmR build -- --watch 

Start the server

npmR start:serve -- --host 0.0.0.0

Run with firebase emulators

Build the app to generate client.html

rm -rf public && PUBLIC_PATH=http://0.0.0.0:8000 npmR build -- --watch

PUBLIC_PATH is the hosting URL, check firebase.json file

Inside functions folder, run webpack in watch mode

rm -rf dist/ && NODE_ENV=production npmR build -- --watch 

Start the emulators

npmR start:emulators

GitHub

https://github.com/Ridermansb/react-firebase-ssr


Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

GIPHY App Key not set. Please check settings

BSNL Offers These Affordable 4G Plans to Customers

SADE PIND DE LYRICS – Vicky Dhaliwal, Gurlez Akhtar