Server Side Swift with Vapor: Getting Started | Ray Wenderlich

I just set my app thanks @rwenderlich

Iā€™ve never used Heroku before, say I do some more work on my app, how would I push this to Heroku?

@jonny Just commit your changes to your git repo, and then push up to Heroku.

git add .
git commit
git push heroku master

Thank you!

That was pretty painlessā€¦So Far!

Studied it just now, thank you .

I donā€™t know if anyone else has gotten this error?

Static member ā€˜init(stringInterpolationSegment:)ā€™ cannot be used on instance of type ā€˜Stringā€™

When trying to use string interpolation in the JSON value.

JSON([
ā€œmessageā€:ā€œI drank \(beers) beers!ā€
])

But if you did, this is what I did to fix it. I converted the string into a Node object.

JSON([
ā€œmessageā€:Node(ā€œI drank \(beers) beers!ā€)
])

@rwenderlich
I have a doubtā€¦ Why did you use VAPOR instead of PERFECT, KITURA OR ZEWO?

What was the advantage of going with VAPOR?

1 Like

Hi Ray,
Is it possible for vapour swift to run php? Iā€™m trying to return the files in a folder (when the user click on a dropdown button) that resides in the server side. Or are there other methods of achieving this functionality. Also, will you be coming up with a vapor 2.0 tutorial?Thank you for your help.

Sometimes you need to kill the existing VAPOR instances to start server from fresh . I also faced this issue first time but later it was smooth . Kill Vapor instances if getting server error by following steps:

1.lsof -i tcp:8080 - Gives PID
2. kill -9 (PID)

toolbox.vapor.sh doesnā€™t seem to be a valid URL any longer. How do we install now?

@rwenderlich In case anyone is interested, i posted my Vapor 2 + Swift 4 example implementations for the ā€œServer Side Swift with Vaporā€ series on github: VaporExamplesLab.