Self Hosted
How to self host a jsrepo registry.
jsrepo enables self hosting your registry on the web. This can allow for more customization of exactly how things are served. As well as enabling you to do things like distributing your registry on a private network.
Let's show how you might set this up in a SvelteKit app!
In this case we will have our block located under ./src/lib where components is the category and button is one of our blocks:
We will serve our registry out of the ./static folder (for react this would be ./public) so that users can access our blocks by running:
To do this we need to build the registry using the --output-dir flag. This flag will copy the registry to whatever directory we specify in this case ./static:
You can also customize where blocks are served. You just need to tell jsrepo where the jsrepo-manifest.json is.
Now users can access blocks from either https://example.com/default or https://example.com/new-york:
You can still add fully qualified blocks but as always the path must be complete: