Kodeco Forums

Kitura Stencil Tutorial: How to make Websites with Swift

Did you know Kitura includes a framework for creating web apps? In this Kitura Stencil tutorial, you'll learn all about creating website in Swift!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/93-kitura-stencil-tutorial-how-to-make-websites-with-swift

Hi! I think you want to update the swift-tools dependency at the top of Package.swift in KituraWebInterface_Starter. You have it at 4.1, which I believe is the version that ships with Xcode 9.3, which is High Sierra-only. I got it to build (on 10.12.6, Xcode 9.2) by changing that to 4.0.

Great tutorial!

Unfortunately I had an issue getting anything to display at first. When navigating to localhost:8080 it was showing โ€œCANNOT GET /โ€.

I eventually figured out that the static file server was preventing anything else from rendering.

To fix this, I moved app.router.all(middleware: StaticFileServer()) to the end of the function, after app.router.get(โ€œ/โ€).

After that everything is working for me. Hopefully this will help anyone else who is struggling with the same issue.

Thanks again!

A very great tutorial. I was modifying it for my project where I tried to pass unicode characters like :cow::dog::apple:in the text field, the characters doesnโ€™t render correctly in the frontend. I checked the database from terminal where it shows that it has been saved correctly. Any suggestions how to render the unicode characters?

Thank you!

Hey found the fix here. I had to include heading tag in home.stencil page

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!