Vapor is an open source server side Swift framework, that helps you write web apps and services using Swift 3. Learn how to get started with Vapor, and create your first server side Swift web app.
Does this tutorial assume that I already have Apache setup and running? I’m unable to access localhost so I’m assuming that this may be the case. Either that, or I misconfigured something during a previous attempt at getting server side Swift up and running using another tutorial.
Hi, there. I found on my mac, that the process “httpd” was NOT running by using Activity Monitor and viewing all processes. I had never installed Apache on my box. So I don’t think I had Apache running on my mac, but I was able to start the server in Xcode and use Firefox to look at localhost:8080.
Greetings, Ray. I love all of your tutorials and have been a long time subscriber. But I felt I must comment on this one - it is just so good! I didn’t know about Vapor, but did have a little experience with Heroku for another web app I developed. Your introduction here was very clear and to the point. Setup instructions were right on and very helpful. I learned something new today and that makes me happy! That’s the reason I keep subscribing to you. I look forward to more about Vapor, especially how to integrate with databases. Thanks!
I discovered vapor a couple of weeks ago, so was pleased to see this. I do the vast majority of my web work with Yii. But love Swift.
Although I’ve never used them, it seems to be quite like Node in the way it constructs web pages.
I’d also be interested to know about benchmarks for server-side swift vs other popular web languages or frameworks like:
Django
Python
PHP
Ruby
Node
JS
Update
Found a good benchmark article
The next step for me is now thinking about template engines and how one would go from here to integrate HTML (Mustache.swift)? and how to work with DBs?
@jonny Heh funny you mention that - in my next Vapor screencast I’ll be covering templating, and in the next few screencasts after that I’ll be covering how to work with DBs. Hope it helps! :]
Plaintext benchmark on Go, Java, Swift, PHP and RubyonRails. I believe SSS is using sync on HTTP server, Vapor need asynchronous or better way as good as fasthttp (Go) to improve it. epoll or DispatchSource perhaps?
Netty and Vert.x uses Java NIO which is hellish fast!
Perfect’s feature set is much more limited than Vapor’s. Perfect also depends on C code for HTTP parsing, where as Vapor is pure Swift. This could be what is causing Vapor to lag a bit in those tests.
That being said, those tests do not represent a real world use case. In almost any real application, you’ll be relying on a database which bottlenecks performance.
Additionally, going forward Apple is going to be releasing standardized networking components that all of these frameworks will adopt. At that point, they will all run at the exact same speed and it will be only the feature sets that matter.
I tried to combine another tutorial from appcoda, where the heroku git is set manually, but then it also cannot find the buildpack, with the following error:
My souce folder has a whack of other folders in and then my “App” is at the bottom. Where/how did you rearrange yours? Thanks for the tutorial I just spun my Heroku app up!
@jonny Yes, this has changed since I wrote the tutorial - I haven’t dug into it, but I suspect the Swift Package Manager bundled with Xcode 8.1 changed this behavior.
In the screencasts I’m working on now, I just left things like this, with my App folder on the bottom. A tad annoying but it’s OK. I do like how all the packages are there now, because it makes it a lot easier to browse through the code and set breakpoints if necessary.