/react-server-side-rendering

Express, React Server side rendering

Primary LanguageJavaScriptMIT LicenseMIT

react-server-side-rendering

NodeJs Express, ReactJs, MongoDB

A reactjs server-side rendering proof of concept

Getting Started

Checkout this repo, install dependencies, configure, then start both the api and server.

$ git clone git@github.com:fernandedios/react-server-side-rendering.git
$ cd react-server-side-rendering
$ npm install
$ cd api
$ npm install

-- configure app

$ npm start
$ cd ..
$ npm start

Configuration

This web application requires the following as starting point:

Local Development Variables

module.exports = {
  googleClientID: 'your_google_client_id',
  googleClientSecret: 'your_google_client_secret',
  mongoURI: 'mongodb://your_mongodb_development_url',
  cookieKey: 'your_cookie_key'
};

cookieKey is a random string used for encryption. Save as 'dev.js' and place it inside the api/config folder.

Production Environment Variables

You will need to add the following environment variables to your production host

GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET,
MONGO_URI,
COOKIE_KEY

COOKIE_KEY is a random string used for encryption.

Thanks

react-server-side-rendering* © 2018, Fernan de Dios. Released under the MIT License.

fernandedios.com  ·  GitHub @fernandedios  ·  Twitter @fernan_de_dios