web2blob
A small utility to upload your web assets to Azure Blob Storage. The idea is that after you build your website with tools like Create React App, you could upload it to a blob, and then put a CDN in front of it.
Requirements
This application requires Node 4+ to run.
What differences does it have with Azure CLI upload-batch?
- Will infer the Content-Type for all your files.
- Will gzip the files for you.
- Will set a Cache-Control for regular assets, and a long cache for static assets.
Install
As a CLI tool
npm install -g web2blob
As a library
npm install --save-dev web2blob
CLI
web2blob -s webfolder -d container [options]
Run web2blob --help
to get a quick overview of all commands.
API Usage
const web2blob = require('web2blob');
const options = {
source: './build',
destination: 'myweb',
cache: 3600,
maxConnections: 5,
statics: 'static',
zip: true
};
web2blob(options)
.then(() => {
})
.catch(error => {
});