Walkthrough - Getting Started Creating Your Own Bower registry
Setting up your own Bower registry has never been easier. MyGet allows you to create your own public or private Bower registries in just a few clicks and work with your own Bower packages. This section will guide you through it.
Creating a new feed
Browse to MyGet.org and log in using your preferred identity provider.
Complete your new MyGet profile by providing a username and password. These are your MyGet credentials, which you'll need to authenticate against private feeds on MyGet.org. From now on, you can also use these to log in on the MyGet.org web site.
Create a new feed that will serve as a registry and select the desired security template: public, private or community
- public: everyone has read access, only feed owners/managers can write
- private: only users with explicitly granted permissions can read or write (depending on permissions)
- community: everyone can read all packages + anyone can manage the packages they pushed to the feed
(optional) Invite collaborators through the feed security settings.
Working with your Bower registry
Register the feed with Bower by adding a registry entry to your
.bowerrc
file. The full feed URL can be found on the feed details page.The easiest way of registering the feed is running the following command:
echo {"registry": "https://www.myget.org/F/your-feed-name/bower/"} > .bowerrc
For private feeds, make sure to either use a pre-authenticated URL or include the username and password in the registry URL:
echo {"registry": "https://username:password@www.myget.org/F/your-feed-name/bower/"} > .bowerrc
Note: If you have any special characters in your username or password, such as an @ or a space, make sure to use the URL encoded value (e.g. `%40` for @, %23 for #, %2F for / and so on).
Add packages to the feed by through the web site, mirroring them from the Bower registry, or pushing them using the Bower client.
On each feed, packages can be added through the web UI.
(optional) Enable upstream source proxy to seamlessly blend your MyGet feed with the public Bower registry.
From the Upstream Sources tab, edit the Bower.io upstream source and enable the Make all upstream packages available in clients option. If you prefer to have the package binaries downloaded to your feed for subsequent requests, also enable the Automatically add downloaded upstream packages to the current feed (mirror) option.
Note that using these settings it's also possible to blend more than one Bower registry into one.
Pushing a Bower package to your feed
You can easily upload a Bower package through the web site, but if you prefer to automate this in a non-interactive way, you can still do so. Unfortunately, Bower does not have an official API to push packages, so you'll have to use a tool such as cUrl
to accomplish this task.
The request to make is an HTTP POST
, towards https://www.myget.org/F/yourfeedname/bower/upload.
- Add a header:
X-NuGet-ApiKey
- with the value of one of your access tokens (aka API key). - Add request body: the ZIPped Bower package (basically a
ZIP
file containing your entire package +package.json
)
Read our contribution guidance or edit this page's source on GitHub.