How to Host Data via Local HTTP Server?¶
This guide explains how to host spatial transcriptomics dataset folders over HTTP for testing or sharing with CartoScope.
1. Prepare Your Processed Dataset Folder¶
Ensure your processed dataset directory contains the catalog.yaml catalog file, PMTILES image files, spatial factor/gene expression data matrices, and metadata.
1 2 3 4 5 6 | |
2. Start a Local HTTP Server with CORS Enabled¶
CartoScope requires Cross-Origin Resource Sharing (CORS) header support when fetching remote data chunks. Start a lightweight Node.js HTTP server using npx http-server:
1 | |
Why is the --cors flag required?
CartoScope executes in your web browser and fetches binary data tiles (.pmtiles, .parquet) from your HTTP server (http://localhost:8080). Enabling CORS allows your browser to download these data assets without cross-origin security blockades.
3. Get the Entry Point URL¶
Your dataset's entry point is the YAML file containing metadata about your dataset, typically named catalog.yaml (for single datasets) or multi-catalog.yaml (for multi-sample cohort sessions).
3.A Single Dataset Entry Point (catalog.yaml)¶
1 2 3 4 5 6 7 8 9 | |
Why specify /catalog.yaml in Option A?
When serving directly from inside a dataset folder, http://localhost:8080/ represents the root server origin rather than a named subfolder path. To avoid ambiguity between the server origin and catalog file, you must explicitly specify the catalog filename (e.g. http://localhost:8080/catalog.yaml) so CartoScope can fetch the metadata file directly.
Use Folder URL
If your data are served from a parent directory (Option B) and your metadata file is named catalog.yaml, you can also use the subfolder URL as the entry point:
1 2 | |
3.B Multi-Sample Cohort Session Entry Point (multi-catalog.yaml)¶
To launch a multi-sample session containing multiple sample slides, reference the multi-catalog.yaml file:
1 2 3 4 5 6 7 8 9 | |
Use Folder URL
If your data are served from a parent directory (Option B) and your metadata file is named multi-catalog.yaml, you can also use the subfolder URL as the entry point:
1 2 | |
Related Pages
Concepts
Manual Pages
How-to Guides
FAQs