Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
terriajs-server
Advanced tools
NodeJS server for TerriaJS, consisting of a CORS proxy, proj4 CRS lookup service, and express static server.
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.wwwroot
directory you provide on the command line, which defaults to ./wwwroot
[wwwroot]/404.html
and/or [wwwroot]/500.html
exist, they will be served for those HTTP error codes.proxyauth.json
file.Generally, you don't want to manually install TerriaJS-Server. It comes installed with TerriaMap (see below).
git clone https://github.com/terriajs/terriajs-server
cd terriajs-server
npm install
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
.
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]
npm test
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.1
FAQs
NodeJS server for TerriaJS, consisting of a CORS proxy, proj4 CRS lookup service, and express static server.
The npm package terriajs-server receives a total of 186 weekly downloads. As such, terriajs-server popularity was classified as not popular.
We found that terriajs-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.