4.0.0 • Published 1 year ago

terriajs-server v4.0.0

Weekly downloads
404
License
Apache-2.0
Repository
github
Last release
1 year ago

TerriaJS-Server

Greenkeeper badge

Build Status


We have just released a brand new version of Terria verson 8!

We've put together a list of things we've removed from version 8 and some steps to help you migrate to the new version in our migration guide

Not ready to move to version 8 yet? You can find terriajs version 7 here: https://github.com/TerriaJS/terriajs/tree/terriajs7


This is a basic NodeJS Express server that serves up a (not included) static TerriaJS-based site (such as National Map) with a few additional useful services:

  • /api/v1/proxy: a proxy service which applies CORS headers for data providers that lack them. Add URLs to config.json to enable them.
  • /api/v1/proj4def: a proj4 coordinate reference system lookup service.
  • /api/v1/proxyabledomains: return a JSON of domains the server is willing to proxy for
  • /api/v1/ping: returns 200 OK.
  • /api/v1/share/X-Y (GET): uses prefix X to resolve key Y against some configured JSON storage provider (Gist and AWS S3 implemented)
  • /api/v1/share (POST): stores a piece of JSON with a configured storage provider (Gist implemented)
  • /api/v1/serverconfig: retrieve (safe) information about how the server is configured.
  • All other requests are served from the wwwroot directory you provide on the command line, which defaults to ./wwwroot
  • If files [wwwroot]/404.html and/or [wwwroot]/500.html exist, they will be served for those HTTP error codes.
  • Supports very simple authentication via a single username/password included in requests using HTTP basic authentication.
  • Proxied services that require HTTP authentication can be proxied by adding credentials to a proxyauth.json file.
  • It can be run in HTTPS mode, although there are better ways of doing that in production.

Generally, you don't want to manually install TerriaJS-Server. It comes installed with TerriaMap (see below).

Stand-alone installation (without serving TerriaMap)

Install

  1. git clone https://github.com/terriajs/terriajs-server
  2. cd terriajs-server
  3. npm install

Configure

Copy serverconfig.json.example to serverconfig.json and configure as needed. See comments inside that file. (Comments are allowed; see json5.org).

If you want to proxy authenticated layers, do the same for proxyauth.json.example.

Run

  1. npm start -- [options] [path/to/wwwroot]
terriajs-server.js [options] [path/to/wwwroot]

Options:
  --help, -h     Show this help.                                       [boolean]
  --version      Show version number                                   [boolean]
  --port         Port to listen on.                [default: 3001]      [number]
  --public       Run a public server that listens on all interfaces.
                                                       [boolean] [default: true]
  --config-file  File containing settings such as allowed domains to proxy. See
                 serverconfig.json.example
  --proxy-auth   File containing auth information for proxied domains. See
                 proxyauth.json.example
  --verbose      Produce more output and logging.     [boolean] [default: false]

For example, to run with port 3009:

npm start -- --port 3009

To run the server in the foreground, you can do this:

node . [arguments as above]

Tests

  1. Run npm test

Installation with TerriaMap

Just install TerriaMap. TerriaJS-Server is installed to node_modules/terriajs-server, and you can run it manually as node_modules/terriajs-server ./wwwroot.

4.0.0-alpha.1

1 year ago

4.0.0

1 year ago

3.3.4

2 years ago

3.3.3

3 years ago

3.3.2

3 years ago

3.3.1-alpha.5

4 years ago

3.3.1-alpha.3

4 years ago

3.3.1-alpha.2

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago

3.0.0-test-3

5 years ago

3.0.0-test-2

5 years ago

2.9.0

5 years ago

2.8.0

6 years ago

3.0.0-test-1

6 years ago

2.7.4

6 years ago

2.7.3

6 years ago

2.7.2

6 years ago

2.7.1

6 years ago

2.7.0

7 years ago

2.6.7

7 years ago

2.6.6

7 years ago

2.6.5

7 years ago

2.6.4

7 years ago

2.6.3

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

8 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago