https://github.com/codesandbox/sandpack-cdn
https://github.com/codesandbox/sandpack-cdn
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codesandbox/sandpack-cdn
- Owner: codesandbox
- License: apache-2.0
- Created: 2021-11-26T14:49:06.000Z (over 4 years ago)
- Default Branch: next
- Last Pushed: 2024-08-31T16:47:22.000Z (almost 2 years ago)
- Last Synced: 2025-04-24T04:37:05.882Z (about 1 year ago)
- Language: Rust
- Size: 644 KB
- Stars: 32
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sandpack NPM CDN
The sandpack cdn is used to serve npm modules in a browser-optimized way, by having the entire npm registry on disk and query it, download the needed files from npm and serve those in a msgpack bundle to the client. Besides this it always add a really fast resolver that uses the in-memory/on-disk npm registry.
## Running the project
Run the following command: `cargo run`
## Environment variables
### Port
Define a custom port to start the server on
Example: `PORT=1234` - Defaults to 8080
### Database
To run this locally you need to define the location of the rocksdb database, which is where the sandpack cdn stores all the data it needs.
Example: `NPM_ROCKS_DB=/persisted/npm_rocks_db`
### Tracing
- OpenTelemetry exporter endpoint: `OTEL_EXPORTER_OTLP_ENDPOINT`
- OpenTelemetry metadata headers, prefix with `OTEL_METADATA_`, for example for honeycomb you add: `OTEL_METADATA_X_HONEYCOMB_TEAM=`