
Surge – Static Web Publishing for Front-End Developers - stevelacy
https://surge.sh/
======
sotojuan
I'm not a paying customer of or affiliated with Surge—just a happy user.

Surge is what I've always wanted to when I do frontend development for fun and
learning. This is especially true if you're new. When you're new, you don't
want to set up a server to push to Heroku or Digital Ocean, you may not want
to use GitHub pages, or other alternatives (not aware of all, just the ones I
mentioned). You may still be new to git and git-based deployments.

Surge is simple: `surge -p build` will upload the `build` directory and give
you a nice HTTPS URL to share with your friends. `surge` does the same with
the current directory. You can pick a URL under their domain or use one you
own. It all takes a few seconds. Perfect for portfolios, demos, etc.

If you use npm you can `npm install --save-dev surge` and add a script that
does your production build step and then calls surge to deploy it.

Very underrated service!

~~~
windsurfer
I'm still confused what this service does. `surge -p build` and `npm install
--save-dev surge` is simpler for a newbie than getting sftp credentials to a
shared host? My designer friends can drag and drop, but certainly stay away
from the console.

~~~
rakoo
You'll need a shared host first. surge automatically gives you that.

~~~
windsurfer
Ah! That's really cool then! I thought it was just the command line tool.

------
juandazapata
Nice service, but too expensive to be honest. My static websites (built with
middleman) are hosted in Amazon S3 as a static website bucket and have a
Cloudfront distribution in front of it. I use `middleman s3_sync` to deploy
the build in one command and it takes care of everything, even Cloudfront
invalidation. All for just a few pennies per month.

Anyway, keep up the good work.

~~~
sintaxi
Hi, Brock from surge.sh here.

We are still figuring out our pricing. It kind of kills me to hear someone
call surge too expensive. We worked hard to give surge a very legit free
offering which is serving over 35k projects. Surge gives (currently) unlimited
projects with custom domains. We charge $13/mo for that extra 1% which is
custom SSL, basic auth, custom redirects.

Very open to suggestions if you have any. Would you prefer we have a small
membership fee and open up all the features? What would you suggest is fair?

~~~
nathancahill
It would be cool to see a $2/mo option for people that want to support the
project (same features as the free tier).

------
pyrophane
One of the testimonials:

"From now on, I think I'm going to strive to build all my apps as fully static
sites."

What? I can understand the idea of not overcomplicating an app when you don't
need to, but how does this goal make sense for anyone who wants to build
anything non-trivial?

~~~
igorgue
Done this many times, in fact currently I deploy to S3 (look for "static
website") and the static site interacts with an API.

This is the whole point of JavaScript frameworks to me. And definitely not
trivial stuff.

~~~
pyrophane
I understand the architecture you are describing, and I don't think that it is
trivial. My confusion is over what really constitutes a "fully static" app.

~~~
jqueryin
IMO, static doesn't have to have a correlation to being simpler.

HTML, CSS, JS, and media are all static assets but you're welcome to request
whatever datatypes you want behind the scenes via AJAX and/or CORs.

The benefits are entirely in the rendering speeds of an optimized web server
and cache layer. Also, this approach plays extremely nicely with CDNs.

Difficulties can arise if you have to begin dealing with versioning of your
assets to avoid cache invalidation, but that's what a proper build process can
add to the static site.

~~~
aeosynth
Is the performance/simplicity that much better than setting up Cloudflare
yourself?

------
zackbloom
If you're interested in setting up something similar on AWS, you could take a
look at Stout [1].

[1] [http://stout.is](http://stout.is)

~~~
atjoslin
+1 -- I use Stout all the time. I don't have to rely on anyone's uptime except
AWS's. Stout's just a "shortcut" for using AWS infrastructure that I have full
control of.

With Surge, I'd have to trust some startup's build tool not to fail at a vital
time.

------
cyberpanther
I don't work directly with Surge but the other developers where I'm at have
found Surge to have too much downtime and we're moving off of it now. Maybe in
the future they will have a more reliable service, but right now you'll
definitely experience the growing pains of a new tool.

~~~
chrisan
Was the downtime with the static website itself or the deployment tools?

~~~
cyberpanther
static website

------
pesfandiar
Very nice. Services like this can help keep the costs and maintenance of
smaller projects to a minimum. I myself created a proof-of-concept online
programming judge without any server (see
[http://www.pesfandiar.com/blog/2016/05/12/javascript-
online-...](http://www.pesfandiar.com/blog/2016/05/12/javascript-online-
hosting-static-site-cheaply)). I only used Google Cloud Platform and
Cloudflare at virtually no cost.

I wish they had some minimal features that you'd need a server for. I'd pay
$5-10/mo to get some basic authentication, custom headers, and maybe even some
sort of user-specific key-value store.

------
munro
I've been using neocities.org for the same purpose, compile a web app, signup
for an account, and drop the assets.

[https://3d3d3d.neocities.org/](https://3d3d3d.neocities.org/)

------
nathancahill
Love Surge so much. The CLI interface is stellar. We use it for testing
feature branches of frontend code. Writing a tool to automatically spin up an
environment for every pull request (alongside the CI). Helps the whole team
test new features without having to pull down the branch and review locally.

------
hanniabu
I mean, if you're doing a static site you can also use github pages with a
simple push command. Is there some difference between surge and doing this
that I'm not seeing?

~~~
sintaxi
If you are properly preparing your assets for web distribution you really
don't want those files in a git repo. it messes up your commit history and
doesn't provide much value. I think gh-pages is fundamentally broken for this
reason. IMHO its best to keep your source files in a git repo and publish your
compiled assets to surge.

~~~
wilg
[https://github.com/edgecase/middleman-gh-
pages](https://github.com/edgecase/middleman-gh-pages) solves this problem by
letting you do all your work on the master branch, then your build script
compiles all your assets and commits them to the gh-pages branch, so it
doesn't pollute your Git history.

------
piotrkubisa
Interesting idea for making kind of a PaaS for static websites.

I have been using a Firebase Hosting [1] (provides free https, CDN, CLI
publish with `firebase serve`) for a while. Obviously, Firebase quotas and
pricing is way another but I am curious how do you compare Surge to Firebase
Hosting?

[1]
[https://firebase.google.com/docs/hosting/](https://firebase.google.com/docs/hosting/)

------
gk1
See also [https://www.netlify.com/](https://www.netlify.com/) ... Not sure on
exact differences between the two, maybe someone who's used one or the other
can chime in?

~~~
bobfunk
I'm a co-founder of netlify and happy to chime in.

Surge is a simple tool with a really awesome CLI for deploying static sites
quickly.

At netlify we're building a larger platform for working with a modern static
approach.

We have an integrated continuous deployment platform. That way you just link a
git repository to netlify, and we'll do the build whenever you push to git and
even give you preview deploys of pull requests.

We run our own content delivery network, which means a lot for performance,
and can post-process assets to automatically serve them out of a larger asset
CDN with far future expires headers.

Netlify has built in Let's Encrypt support with a 1 click setup. We'll do
automatic certificate rotation and enable HTTP2 when HTTPS is turned on.

Our CDN can handle complex proxying and redirect rules. If part of your site
need to go to a dynamic backend or if you need API proxying, a one-line rule
can set this up. We can even handle gradual migrations from a dynamic to a
static approach by proxying all non-static requests straight from the CDN to a
dynamic origin.

Apart from that we have lots of extra features like built-in pre-rendering for
single page apps, Geo IP based redirect and rewrite rules, JavaScript snippet
injection for easy analytics setup, form processing, etc, etc...

------
excitom
It feels like 1994 again! Just rcp an HTML file from my workstation to the web
server!

------
ozten
Another interesting competitor is PubStorm
[https://www.pubstorm.com/](https://www.pubstorm.com/)

Their price is TBD, but they have a cool "quick and easy revert" feature.

~~~
pbreit
I came to mention PubStorm which I started using recently and have been
pleased so far. I got the impression that some reasonable service would remain
free?

Hoe does Surge compare?

~~~
ozten
Sorry, yes they both have a free offering.

------
damaru
As a web developer I feel sometime solution like that remove the understanding
of how the internet works. This script can be replaced by a tiny shell script,
that runs a rsync of the dev folder to your server, and I think it is
important to know basic scripting like that even for a front end dev. I have
to say that I haven't tried the script but I haven't seen anything impressive
from the presentation video.

------
jordanlev
Is there a difference between what Surge offers versus ngrok?

(Genuinely curious, not trying to imply that "this has been done before" or
shouldn't exist!)

~~~
mikey_p
I was under the impression that ngrok only provided tunnels, while surge only
provides hosting/CDN.

~~~
jordanlev
Ah, yes that makes sense -- thanks!

------
Rabidgremlin
Along similar lines I have been playing with Bitbucket Pipelines and Hugo to
build static websites on commit and deploy them to S3 buckets. Really like the
way they use docker containers as build agents, it's very tidy:
[https://github.com/rabidgremlin/hugo-s3](https://github.com/rabidgremlin/hugo-s3)

~~~
kannonboy
Nice one! I'm a developer from Atlassian, it's cool to see the different CI/CD
applications that Pipelines is being used for.

Regarding static site deployment specifically, Aerobatic
([https://www.aerobatic.com/](https://www.aerobatic.com/)) have a similar
static site publishing offering via a Bitbucket add-on, though it uses Lambda
rather than Pipelines. They've got a couple of other nifty features like auto-
renewing SSL certificates, too.

~~~
nstj
Nice tip!

------
krat0sprakhar
Don't have enough good things to say about Surge. Wonderful service, damn easy
to work with, great number of features (even in the free plan).

------
kentor
Very nice service and interface. Only issue I've had was when my site went
down a couple of times due to issues at DigitalOcean.

~~~
sintaxi
Brock from surge here. I would just like to clarify causes of our downtime
because we like DigitalOcean very much and dont want people to have the wrong
idea.

In the 1 year we have been available we have had 3 incidences each for
different reasons.

The first was DigitalOcean taking us offline for not complying with a DMCA
takedown request. This was before Digital Ocean knew who we were and they
expected foul play. From this incident DO reviewed their policies on removing
network access to customers and show genuine remorse for the downtime. Like I
say we have been very happy with DO and would definitely recommend them.

The second downtime was due to user error on a bad deploy and the system
unraveled in a sense. This was a result of several poor things that made the
system more brittle than it should be. Somewhat significant architecture
changes have happened as a result and more are underway.

Last, and most recently was two DDoS attacks on our floating IPs within days
apart. Learning lots still about how to best protect our customers from this.
System changes and mitigation plans are being put in place to protect our
customers from these sorts of attacks in the future.

------
gumby
grumble: they mention git hooks (and if you click on the description they are
RCS agnostic) but they use the octocat logo.

Just yesterday I mentioned that I was using git and my gf assumed I meant
github. She (not a developer) thought that git was a product sold by github.

~~~
sintaxi
The octocat is in reference to the example app but I can see the confusion.

------
johnwheeler
pretty!

------
romanovcode
>Free SSL for surge.sh subdomains

Wow! Thanks! It's not like I can just get it for free on any domain I like.
Not even speaking about servers like Caddy that can do that automatically on
launch.

~~~
scrollaway
Why the snark? Is this how you communicate in everyday life?

