Running a public Vapor Server from your MacBook

Ian Keen
Ian Keen
Jul 22, 2016 · 1 min read

I’m doing a lot of server side Swift lately — primarily working on my Slackbot Chameleon. I am working on a new feature that requires a HTTP server and I’ve decided to use Vapor. The problem is when trying to debug locally I was unable to expose my macbook builds in a way that is publicly visible to the internet.

It seemed like the only solution would be to deploy each time I wanted to test… which would be fine but you don’t have access to breakpoints for example.

Then I came across a tool called LocalTunnel. Once you run it it will give you an external url that you can use to access your machine and the listening Vapor instance, no additional config is required for Vapor either!

To install all you need to do is (node.js required):

npm install -g localtunnel

Then to start the tunnel:

lt --port 8080

And that’s it!

Image for post
Image for post

I highly recommend using this if you are doing any work with Vapor — it makes the development cycle much easier.

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