Deploy Angular Apps To Surge

Junior Gantin
Jan 14, 2018 · 2 min read
Image for post
Image for post

I usually use Heroku for hosting my Angular Apps. It works fine but I want to try anything else: something new, something smart. I heard about two deploying tools dedicated to front-end developers: Netlify and Surge. In this article, I will show you how to deploy Angular apps to Surge.

What’s Surge?

How to do it?

$ npm install -g surge

Create a new Angular app:

$ ng new angular-surge
$ cd angular-surge

What you need to do now is to build your application for production environment.

$ ng build --prod

Now angular-cli put the build artifacts into dist folder. You need to deploy this folder with surge. Let’s move into dist folder with command line and start deploying.

$ cd dist
$ surge

Voila! Account creation will happen on your first run. Surge will show you where your application is alive on. Enjoy!

You can do more with Surge. Custom domain, 404 page, SSL and so more. Here is where you can start with these functionalities of Surge.

Never forget that you can deploy your Angular apps in one minute or less with Surge!!!

Happy coding!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store