9 ms·
Surge – Static Web Publishing for Front-End Developers
- johnwheeler 10y agopretty!
- sotojuan 10y agoI'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 10y agoI'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 10y agoYou'll need a shared host first. surge automatically gives you that.
- windsurfer 10y agoAh! That's really cool then! I thought it was just the command line tool.
- krat0sprakhar 10y agoDon'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 10y agoVery 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 10y agoBrock 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.
- nathancahill 10y agoLove 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.
- excitom 10y agoIt feels like 1994 again! Just rcp an HTML file from my workstation to the web server!
- juandazapata 10y agoNice 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.
- davidcelis 10y agoThis is the same reason I ended up with S3/Cloudfront as well. A while ago, I was moving my site from GitHub Pages. I wanted HTTPS for my custom domain and more control over how my site was cached. I looked at Surge and, as much as I loved their defaults and CLI tool, that $13/mo price tag was too high.
- bennylope 10y agoI wouldn't be too quick to say it's too expensive. My set up is not dissimilar to your own. I'm comfortable working on the command line, using s3cmd to sync the site, modifying bucket policies, etc. Once you know those things - or if you enjoy learning them - it's all pretty trivial, but if you don't... well don't underestimate the hassle for someone who doesn't know this stuff. I'd think it a waste to pay $13/mo for what I'm happy to throw in an S3 bucket, but that's 3 venti lattes for someone not to have to deal with any of it. It's not the file storage they're charging for.
- juandazapata 10y agoI agree with you. It's just too expensive for me, maybe not for others. In the end they are just tools, and you should use whatever fits you better.
- cfjedimaster 10y agoAlso remember that's 13 bucks to get custom SSL, redirects, etc. If you have simple pages w/o the need of https, it costs nothing.
- 10y ago
- damaru 10y agoAs 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.
- romanovcode 10y ago>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 10y agoWhy the snark? Is this how you communicate in everyday life?
- piotrkubisa 10y agoInteresting 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 10y agoSee 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 10y agoI'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...
- zackbloom 10y agoIf 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 10y ago+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.
- hanniabu 10y agoI 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?
- wilg 10y agoI used to use GitHub Pages, but you can't have a custom domain that has SSL, so I switched to Surge like six months ago, and it works great. To be honest, though, if GitHub adds custom domains with SSL to pages, I'll probably switch back.
- sintaxi 10y ago`(ノಥ,_」ಥ)ノ彡┻━┻`
- wilg 10y agoThe deploy process is much easier for me to manage on GitHub Pages, because I can just do "rake publish" and middleman-gh-pages deploys the site. Neither I nor my collaborators have to deal with the details of deploying. Surge makes you remember to call the surge command with the proper arguments and have collaborators also have surge accounts set up properly. Maybe there's a way to have a GitHub webhook automatically trigger a deploy to Surge? That would probably solve this issue for me. Though GitHub Pages is still easier.
- michaelmior 10y agoYou could set up a Travis CI job to build and deploy the site on every push. https://surge.sh/help/integrating-with-travis-ci https://surge.sh/help/integrating-with-travis-ci
- Santosh83 10y agoHave you considered Gitlab, which does advertise custom domains for which you can upload your own SSL certs? Even at the free plan level. I would switch to it if not for the fact that my site isn't dealing with any kind of sensitive stuff so I figured Github Pages with Cloudflare's SSL was enough, although I'm aware its not end-to-end.
- pesfandiar 10y agoVery 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-hosting-static-site-cheaply http://www.pesfandiar.com/blog/2016/05/12/javascript-online-...). 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.
- jordanlev 10y agoIs 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!)
- pyrophane 10y agoOne 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?
- savanaly 10y agoDid he perhaps mean build all his apps as single page apps? A react or angular site that uses ajax to load all data is, in some sense, fully static. This only applies if you consider the term "app" as applying only to the frontend part of your app. But that might make sense if your backend is all firebase or some other api.
- ccallebs 10y agoFully static sites don't necessarily mean static content in a user interaction sense. A lot of blogging platforms are database driven, but generate static documents instead of rendering the pages on the fly. I agree it's a hyperbolic claim but it can work depending on the domain.
- igorgue 10y agoDone 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.
- debaserab2 10y ago> This is the whole point of JavaScript frameworks to me. What does it matter if your front endpoint is on S3 or being served by your own web server? Delivering static assets isn't that hard and you don't solve a lot by hosting the front end point of your app on S3. Your bottleneck is way more likely to be your API long before static asset serving is a problem.
- pyrophane 10y agoI 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.
- Rabidgremlin 10y agoAlong 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 10y agoNice 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 10y agoNice tip!
- pbreit 10y agoThat all sounds like crazy overkill for static sites?
- munro 10y agoI'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/
- ozten 10y agoAnother 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.
- cyberpanther 10y agoI 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.
- sintaxi 10y agoHi, Brock here from surge. We are having growing pains no question. We have learned lots about our system recently due to some of these incidences. Changes are underway to make the system more fault tolerant and resilient to attacks. Give us time to make things better and please keep us on your radar.
- chrisan 10y agoWas the downtime with the static website itself or the deployment tools?
- cyberpanther 10y agostatic website
- gumby 10y agogrumble: 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 10y agoThe octocat is in reference to the example app but I can see the confusion.
- deleted 10y ago[deleted]