Skip to content

rsksmart/rsk-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a2b110b · Jan 8, 2021
Jan 9, 2020
Dec 1, 2020
Jan 8, 2021
Jan 8, 2021
Jul 23, 2018
Dec 9, 2017
Nov 4, 2020
Nov 4, 2020
Apr 6, 2020
Jan 10, 2020
Dec 12, 2018
Jan 8, 2021
Dec 31, 2019
Sep 1, 2020
Dec 24, 2019
Aug 13, 2020
Jan 8, 2021
Jan 8, 2021
Nov 4, 2020

Repository files navigation

rsk-explorer client

Web client for rsk-explorer-api

Tasks

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# serve with tracking
npm run dev-with-tracking

# build for production with minification
npm run build

# build for production with google tracking and hotjar 
# you must set the GA-TAG and HOTJAR_ID first, see 'Settings'
npm run build-with-tracking

Deployment

Install dependencies

npm install

Settings

The configuration is provided through this environment variables:

  • WS_URL: rsk-explorer-api WS url (backend)
  • STATS_URL: rsk stats web (link redirect the 'stats' link)
  • GA_TAG: (optional) Google analytics tag.
  • HOTJAR_ID: (optional) Hotjar ID.

E.g. to change the backend url :

  export WS_URL=wss://backend.rsk.co

Building for production

  npm run build

Serve ./dist folder on web server

HTTP Server configuration

The client uses vue-router HTML 5 History mode, this requires a special configuration of the web server:

nginx:

location / {
  try_files $uri $uri/ /index.html;
}

Double slashed paths

Double slashed paths fail on router resolution

E.g. https://explorer.rsk.co//block/123 To avoid this errors use the HTTP Server to rewrite the paths.

nginx:

  merge_slashes off;
  rewrite ^(.*?)//+(.*?)$ $1/$2 permanent;