You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,27 +60,32 @@ npm install
60
60
61
61
By default, STAC Browser will let you browse all catalogs on STAC Index.
62
62
63
-
To browse only your own static STAC catalog or STAC API, set the `catalogUrl` CLI parameter when running the dev server.
63
+
To browse only your own static STAC catalog or STAC API, set the [`catalogUrl`](docs/options.md#catalogurl) config parameter when running the dev server.
64
64
In this example we point to EarthSearch (`https://earth-search.aws.element84.com/v1/`):
This will start the development server on <http://localhost:8080>, which you can then open in your preferred browser.
74
+
70
75
To open a local file on your system, see the chapter [Using Local Files](docs/local_files.md).
71
76
72
77
If you'd like to publish the STAC Browser instance use the following command:
73
78
74
79
```bash
75
-
npm run build -- --catalogUrl="https://earth-search.aws.element84.com/v1/"
80
+
# Linux / MacOS
81
+
SB_catalogUrl="https://earth-search.aws.element84.com/v1/" npm run build
82
+
# Windows (PowerShell)
83
+
$env:SB_catalogUrl="https://earth-search.aws.element84.com/v1/"; npm run build
76
84
```
77
85
78
86
This will only work on the root path of your domain though. If you'd like to publish in a sub-folder,
79
87
you can use the [`pathPrefix`](docs/options.md#pathprefix) option.
80
88
81
-
> [!NOTE]
82
-
> If you are using a recent version of node/npm on Windows, you may need to use `npm run build -- -- ...` instead of `npm run build -- ...`, see <https://github.com/npm/cli/issues/7375> for details.
83
-
84
89
After building, `dist/` will contain all assets necessary
85
90
host the browser. These can be manually copied to your web host of choice.
86
91
**Important:** If `historyMode` is set to `history` (which is the default value), you'll need to add
Copy file name to clipboardExpand all lines: docs/options.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,17 @@ The following options can be provided in various ways to STAC Browser, either wh
6
6
The following ways to set config options are possible:
7
7
8
8
- Customize the **[config file](../config.js)** (recommended)
9
-
- Additionally, some options can be [provided through the **root catalog**](../README.md#customize-through-root-catalog) for consistency across multiple deployments (recommended)
10
-
- Append them to the **CLI** command as parameter (see [Get Started](../README.md#get-started) for an example)
9
+
- Additionally, some options can be [provided through the **root catalog**](../README.md#customize-through-root-catalog) for consistency across multiple deployments
11
10
- Set **environment variables**, all options need a `SB_` prefix.
12
11
So you could for example set the catalog URL via the environment variable `SB_catalogUrl`.
13
12
- Optionally, you can also set options after the build, basically **at "runtime"**.
14
13
Enable this by removing the `<!--` and `-->` around the `<script defer="defer" src="./config.js"></script>` in the [`public/index.html`](../public/index.html).
15
14
Then run the build procedure and after completion, you can fill the `dist/config.js` with any options that you want to customize.
16
15
16
+
> [!WARNING]
17
+
> Appending configuration options as CLI parameters to the CLI command (e.g. `npm run build -- --catalogUrl="https://example.com"`) is DEPRECATED and will be removed in STAC Browser v5.
18
+
> Reason is that such parameters are [not suppored by Vite](https://github.com/vitejs/vite/issues/7065), which will be used in v5 instead of vue-cli.
19
+
17
20
## Table of Contents <!-- omit in toc -->
18
21
19
22
-[Basic configuration](#basic-configuration)
@@ -129,19 +132,17 @@ This also excludes hosting your STAC catalog in the STAC Browser (sub-)folders.
129
132
#### `hash`
130
133
131
134
If your host/server doesn't support URL rewriting or you experience other related problems, you can enable *hash mode*.
132
-
Either set this option to `hash` in the config file or append `--historyMode=hash` when running or building.
135
+
Either set this option to `hash` in the config file or as environment variable (`SB_historyMode`) when running or building.
133
136
Known hosts that require hash mode are Amazon S3 and GitHub Pages.
134
137
135
138
### pathPrefix
136
139
137
140
***build-only option***
138
141
139
142
If you don't deploy the STAC Browser instance at the root path of your (sub) domain, then you need to set the path prefix
140
-
when building (or running) STAC Browser.
143
+
when building (or running) STAC Browser. Known hosts that require hash mode are Amazon S3 and GitHub Pages.
141
144
142
-
```bash
143
-
npm run build -- --pathPrefix="/browser/"
144
-
```
145
+
Either set this option to the respective path (e.g. `/browser/`) in the config file or as environment variable (`SB_pathPrefix`) when running or building.
145
146
146
147
This will build STAC Browser in a way that it can be hosted at `https://example.com/browser` for example.
147
148
Using this parameter for the dev server will make STAC Browser available at `http://localhost:8080/browser`.
0 commit comments