CDN for front-end developers
Publish web apps to a CDN with a single command and no setup required.
This is the CLI client for the surge.sh hosted service. It’s what gets installed when you run
npm install -g surge.
This CLI library manages access tokens locally and handles the upload and subsequent reporting when you publish a project using surge.
It’s easier to show than tell so let’s get to it! The following command will deploy the current working directory to the surge servers where the application will be available at sintaxi.com.
$ surge ./ sintaxi.com
surge --help to see the following overview of the
Surge – Single-command web publishing. (v0.17.6)Usage:surge [options]Options:-p, --project path to projects asset directory (./)-d, --domain domain of your project (<random>.surge.sh)-a, --add adds user to list of collaborators (email address)-r, --remove removes user from list of collaborators (email address)-V, --version show the version number-h, --help show this help messageShorthand usage:surge [project path] [domain]Additional commands:surge whoami show who you are logged in assurge logout expire local tokensurge login only performs authentication stepsurge list list all domains you have access tosurge teardown tear down a published projectGuides:Getting started surge.sh/help/getting-started-with-surgeCustom domains surge.sh/help/adding-a-custom-domainAdditional help surge.sh/helpWhen in doubt, run surge from within you project directory.
If you’re using tools like Grunt, Gulp, or a static site generator like Jekyll, your files are output into a compile directory like
www/. From the root of your project, pass Surge the path to this directory to upload your compiled assets.
You may also add this directory to your
.gitignore to keep your compiled assets out of your Git history.