Serves a local directory of component files as a JSON payload properly formatted to be plugged into a BOS redirectMap
. When paired with a viewer configured to call out to this loader, it enables local component development—especially when working on multiple components in parallel.
Works best when paired with FroVolod/near-social for component syncing and CI/CD
Currently, you must run a viewer instance yourself locally. See Local Component Development
see GitHub Releases
Usage: bos-loader [OPTIONS] <ACCOUNT_ID>
Arguments:
<ACCOUNT_ID>
Options:
-p, --path <PATH> [default: .]
-h, --help Print help
-V, --version Print version
The only required argument is the account which you want to serve the components from
e.g. running from a directory with HelloWorld.jsx
in the following way
bos-loader michaelpeter.near
results in
{
"components": {
"michaelpeter.near/widget/HelloWorld": {
"code": "return <>Hello World</>;"
}
}
}
Run both your viewer and loader behind ngrok to test on multiple devices or share your working copy with others!
Example ngrok config:
authtoken: <automatically populated during setup>
tunnels:
web:
proto: http
addr: 127.0.0.1:3000
subdomain: my-viewer # change this
api:
proto: http
addr: 127.0.0.1:3030
subdomain: my-loader # change this and use in your viewer config
version: "2"
region: us
Then start with ngrok start --all