This repository will host the Global Fishing Watch client application developed by vizzuality
Start by installing the required nodejs packages using npm (already bundled with recent nodejs installations)
npm install
Create a .env file from the provided sample and set the missing values accordingly
Next, start the server by running:
node server.js
You should be able to access your application at http://localhost:3000/
The project includes a set of hooks to automatize boring tasks as well as ensure code quality. To use them, simply enable to built-in git hook manager:
./bin/git/init-hooks
You only need to do this once. If new hooks/changes to existing hooks are brought from upstream, the git hook manager will automatically use them without requiring further actions from you.
Note that as of now, before we fix all errors on the existing codebase, the push will carry on even with errors.
To compile the project to production environment, you need set the NODE_ENV variable value to production and
execute the following command.
npm run build
This command generates a dist folder with the files needed to run application in a nginx or apache server. Your
server needs to be configured to serve all routers from a static index.html file.
Example nginx config
server {
    listen 80;
    server_name myserver;
    location / {
        root    /labs/Projects/Nodebook/public;
        index   index.html;
        try_files $uri /index.html;
    }
}
Example apache configure
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
On server error, the /public/500.html page should be displayed.
Port in which the node server will listen for incoming connections
API key for Google Maps
Environment in which the node server will run (production/development)
If set, an auth wall will be placed in front of the whole node server
If set, the given URL will be loaded using an iframe element, instead of the built in map
Endpoint of the API (vessel tiles, workspace, contact, etc)
URL of the blog
Endpoint of the FAQ section content
Endpoint of the Definitions section content
Endpoint of the Articles & publications section content
Endpoint of the homepage slider section content
Boolean value to determine if the user needs to be logged in to access the map (setting to false is experimental)
Google Analytics tracking code.
Name/ID of the default workspace to be loaded on the map (if USE_LOCAL_WORKSPACE is set to false, see below)
If set, should point to the local workspace to be loaded