Last Updated: July 28, 2016
·
948
· alidavut

Deploy single page applications using Push State

How to deploy your static web page using http://pushstate.io?

Installing CLI

You need to install Push State CLI globally using npm.
npm install pushstate -g

Deploy Some Directory

pushstate deploy <yourDirectory>

The CLI will ask you to login or sign up. Then you will need to create an app or select an app already created. Push State will deploy your files on your-app-name.apps.pushstate.io.

Examples

Deploy current directory:

pushstate deploy .

Assume that we are using webpack and it compiles our files to ./dist folder. Just you need to enter you project directory and type this command:

pushstate deploy ./dist

Custom Domain

Adding a custom domain

Type this command to add a custom domain:

pushstate domains:add

Then you will need to select an app to attach custom domain.

Assume that we have an app named test-app. After you set the custom domain name you will need to add a CNAME record which points to test-app.apps.pushstate.io. You can find your domain service and instruction on Google's amazing help documentation: https://support.google.com/a/topic/1615038

Removing custom domain

pushstate domains:remove

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

Angular apps often share the page with analytics and payment scripts that are not Angular modules. Those scripts execute on the same origin as the framework.

Security insights from Cside