In this video, you'll learn about Vapor and find out what you'll be learning throughout this course.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4493-server-side-swift-with-vapor/lessons/1
In this video, you'll learn about Vapor and find out what you'll be learning throughout this course.
Hi Tim, I appreciate the time you take out of your day to respond. My reddit name is ilovecaketoomuch.
1/ I had to dig for the docs. Perhaps put a link to the official docs? https://docs.vapor.codes/3.0/
2/ I followed along, and it worked out. The challenges are great, maybe a few more would be dandy.
3/ Accepting Data section, how does it figure out to send the http header âapplication/jsonâ, etc?
4/ How do a group a route? pseudo example route like below
Group(âauthâ) {
post(âregisterâ) { ⊠}
pos(âloginâ) {âŠ}
}
Not part of the videos
4/ One of the difficulties I had, not part of the lesson, was adding a controller. In Xcode, I needed to add it to the AppFramework(???) but accidentally added it to the Framework. Still bit confused about that, why it just did not automatically pickup the new controller in the folder.
5/ Async looks awful to use. I am spending time today trying to figure it all out. Futures/Promises.
Warm Regards,
ILoveFreakingLemonCakeTooMuch
@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]
@zsxawerdu thanks for trying it out!
1 - Docs is a good idea, Iâll add a link somewhere. Unfortunately the docs are massively outdated at the moment, but theyâre slowly getting fixed
2 - glad to hear it!
3 - if you set the data to JSON-encoded in Rested it sets that header
4 - to group a route do router.grouped()
- thatâs coming up in the next section
4b - welcome to SPM world! The Xcode project is discardable so you need to regenerate it whenever you add files or make sure you select the correct target if adding via Xcode. Unfortunately Xcode isnât very clever with this at the moment. Creating a controller is covered in the next section
5 - async is a learning curve, but once you understand it itâs ok. Itâs covered in later videos again
The next set of videos were due to be out but unfortunately Iâve had to re-record them due to some fundamental changes in the beta. Iâm getting them done ASAP!
@0xtim Really enjoying this series of videos. Thanks for doing them. Two things I donât see in your list of planned videos that Iâm hoping youâll cover:
@gargoyle unfortunately there wasnât time to fit everything in for the videos so neither of those will be covered. (Though using models that arenât prepared by Vapor is sort of covered in the Authentication videos)
Both topics should be covered in the book however
I need the same topics covered as well!
Hey @0xtim - just wanted to say I absolutely love the series! Thanks!
Hi @0xtim, I installed Xcode 9.3 and the latest Vapor 3.0.0.rc2.2.1 and try to run the above examples. I experience a problem with OpenSSL, it canât open âopenssl/conf.hâ during compilation? Any clue how to fix this in Xcode. I already installed openssl with Brew.
@boersma thatâs not the most helpful error but you need to install LibreSSL. Either upgrade the toolbox or run brew install libressl
Hi @0xtim, this works. Thanks, I also had to add a couple of tryâs and an import of âRandomâ instead of âCryptoâ in Token.swift and than it works fine. Very nice to see it working with swift-nio
@boersma yeah there were a few changes introduced in RC2 mainly because of NIO. The full list is here Changes for the Ray Wenderlich Vapor Videos for Vapor 3 RC 2 · GitHub
I think those 2 topics that @gargoyle mentioned are the most wanted by any developer and itâs hardly covered by any Vapor tutorials. It should be on the video tutorial as well.
@ffabri I had to cut a load of stuff out of the videos and even then everything barely fit. Hopefully the book and online tutorials as Vapor stabilises will cover the missing parts!
Hi I need to know if it is possible to run a swift web services in a local system and have it work with a mobile app , with out actually deploying it to the actual server .
Hi @sarathy - when you say local system what do you mean exactly? On a local network on or the phone?
Yes on a local network . For example if i develop a API using SWIFT and before i copy the files to the server , Is it possible to run the API From my system so that i can access the API from a mobile App .
@sarathy yep you can run a Vapor app anywhere, including in Xcode. The only thing youâll need to change is the hostname to allow other IP addresses to connect to it (other than localhost)
What about using perfect and kitura
@sarathy Same with Perfect and Kitura - itâs just a binary app that you can run wherever