{"id":22282010,"url":"https://github.com/terriajs/terriajs-server","last_synced_at":"2025-04-10T02:24:59.301Z","repository":{"id":44644005,"uuid":"49134328","full_name":"TerriaJS/terriajs-server","owner":"TerriaJS","description":"NodeJS server for TerriaJS, consisting of a CORS proxy, proj4 CRS lookup service, ogr2ogr conversion service, and express static server.","archived":false,"fork":false,"pushed_at":"2024-04-12T00:11:32.000Z","size":1186,"stargazers_count":47,"open_issues_count":25,"forks_count":39,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-04-12T05:17:10.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TerriaJS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-01-06T12:39:33.000Z","updated_at":"2024-04-15T06:12:42.926Z","dependencies_parsed_at":"2024-04-15T06:12:29.283Z","dependency_job_id":null,"html_url":"https://github.com/TerriaJS/terriajs-server","commit_stats":{"total_commits":337,"total_committers":20,"mean_commits":16.85,"dds":0.6676557863501484,"last_synced_commit":"d96739c4702383c2301f473768c52cb896fb8619"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerriaJS%2Fterriajs-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerriaJS%2Fterriajs-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerriaJS%2Fterriajs-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerriaJS%2Fterriajs-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TerriaJS","download_url":"https://codeload.github.com/TerriaJS/terriajs-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143575,"owners_count":21054800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T16:24:32.672Z","updated_at":"2025-04-10T02:24:59.279Z","avatar_url":"https://github.com/TerriaJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TerriaJS-Server\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/TerriaJS/terriajs-server.svg)](https://greenkeeper.io/)\n\n[![Build Status](https://travis-ci.org/TerriaJS/terriajs-server.svg?branch=master)](https://travis-ci.org/TerriaJS/terriajs-server)\n\n--------------------\n\n**We have just released a brand new version of Terria \u0026mdash; verson 8!**\n\nWe'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](https://docs.terria.io/guide/contributing/migration-guide/)\n\n**Not ready to move to version 8 yet? You can find terriajs version 7 here:** https://github.com/TerriaJS/terriajs/tree/terriajs7\n\n--------------------\n\nThis is a basic NodeJS Express server that serves up a (not included) static [TerriaJS](https://github.com/TerriaJS/TerriaJS)-based site (such as [National Map](http://nationalmap.gov.au)) with a few additional useful services:\n\n* `/api/v1/proxy`: a proxy service which applies CORS headers for data providers that lack them. Add URLs to config.json to enable them.\n* `/api/v1/proj4def`: a proj4 coordinate reference system lookup service.\n* `/api/v1/proxyabledomains`: return a JSON of domains the server is willing to proxy for\n* `/api/v1/ping`: returns 200 OK.\n* `/api/v1/share/X-Y` (GET): uses prefix X to resolve key Y against some configured JSON storage provider (Gist and AWS S3 implemented)\n* `/api/v1/share` (POST): stores a piece of JSON with a configured storage provider (Gist implemented)\n* `/api/v1/serverconfig`: retrieve (safe) information about how the server is configured.\n* All other requests are served from the `wwwroot` directory you provide on the command line, which defaults to `./wwwroot`\n* If files `[wwwroot]/404.html` and/or `[wwwroot]/500.html` exist, they will be served for those HTTP error codes.\n* Supports very simple authentication via a single username/password included in requests using HTTP basic authentication.\n* Proxied services that require HTTP authentication can be proxied by adding credentials to a `proxyauth.json` file.\n* It can be run in HTTPS mode, although there are better ways of doing that in production.\n\nGenerally, you don't want to manually install TerriaJS-Server. It comes installed with TerriaMap (see below).\n\n### Stand-alone installation (without serving TerriaMap)\n\n#### Install\n\n1. `git clone https://github.com/terriajs/terriajs-server`\n2. `cd terriajs-server`\n3. `npm install`\n\n#### Configure\n\nCopy `serverconfig.json.example` to `serverconfig.json` and configure as needed. See comments inside that file. (Comments are allowed; see json5.org).\n\nIf you want to proxy authenticated layers, do the same for `proxyauth.json.example`.\n\n#### Run\n\n1. `npm start -- [options] [path/to/wwwroot]`\n\n```\nterriajs-server.js [options] [path/to/wwwroot]\n\nOptions:\n  --help, -h     Show this help.                                       [boolean]\n  --version      Show version number                                   [boolean]\n  --port         Port to listen on.                [default: 3001]      [number]\n  --public       Run a public server that listens on all interfaces.\n                                                       [boolean] [default: true]\n  --config-file  File containing settings such as allowed domains to proxy. See\n                 serverconfig.json.example\n  --proxy-auth   File containing auth information for proxied domains. See\n                 proxyauth.json.example\n  --verbose      Produce more output and logging.     [boolean] [default: false]\n```\n\nFor example, to run with port 3009:\n\n`npm start -- --port 3009`\n\nTo run the server in the foreground, you can do this:\n\n`node . [arguments as above]`\n\n#### Tests\n\n1. Run `npm test`\n\n### Installation with TerriaMap\n\nJust [install TerriaMap](http://terria.io/Documentation). TerriaJS-Server is installed to `node_modules/terriajs-server`, and you can run it manually as `node_modules/terriajs-server ./wwwroot`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterriajs%2Fterriajs-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterriajs%2Fterriajs-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterriajs%2Fterriajs-server/lists"}