Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ This requires our commit messages to conform to [Conventional Commits](https://w

See [deploy.yaml](./.github/workflows/deploy.yaml) for a (drop-dead simple) example of deploying this application as a static site via Github Pages.

### White-label deployment

You can deploy your own customized version of stac-map using environment variables:

| Variable | Description | Default |
| ------------------- | ---------------------------------- | ------------------ |
| `VITE_BASE_PATH` | URL path prefix (e.g., `/my-app/`) | `/stac-map/` |
| `VITE_DEFAULT_HREF` | STAC resource to load on startup | None (shows intro) |

Example:

```shell
VITE_BASE_PATH=/ VITE_DEFAULT_HREF=https://my-stac-api.com yarn build
```

Or create a `.env` file:

```shell
VITE_BASE_PATH=/
VITE_DEFAULT_HREF=https://my-stac-api.com
```

Then run `yarn build` and deploy the `dist/` directory to your static hosting provider.

## Versioning

For now, we use a form of [Sentimental Versioning](https://github.com/dominictarr/sentimental-versioning#readme), where we use MAJOR, MINOR, and PATCH versions to communicate the "weight" of changes.
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/href-param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function getCurrentHref(): string {
}

function getInitialHref(): string | undefined {
const href = getCurrentHref();
const href = getCurrentHref() || import.meta.env.VITE_DEFAULT_HREF || "";
try {
new URL(href);
} catch {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import tsconfigPaths from "vite-tsconfig-paths";

// https://vite.dev/config/
export default defineConfig({
base: "/stac-map/",
base: process.env.VITE_BASE_PATH || "/stac-map/",
plugins: [react(), tsconfigPaths(), wasm(), topLevelAwait()],
});