Questions tagged [server-side-swift]

79 questions
1
vote
1 answer

How to read and write images to web root directory in Perfect-Swift?

I have hosted a Perfect-Swift web application in a Ubuntu Linux server. I'm looking for a way to read an image file from the web root directory and convert it to base64 compatible string to send in the response.
rajeeva9
  • 139
  • 12
1
vote
0 answers

Models in Perfect (Server-Side Swift) and StORM

I have some question about modeling in Perfect and using StORM (MySQL-StORM in my case). Assume we have models named User and Note with these simple rules: Users have id, firstName, lastName, age(optional) Notes have id, title, content Users could…
Omid Golparvar
  • 468
  • 5
  • 12
1
vote
1 answer

Kitura with CouchDB - Problems Importing CouchDB Module

I am trying to use CouchDB in my Kitura server side Swift app. I have my Package.swift with all the dependencies as shown below: let package = Package( name: "hello-kitura", dependencies:[ …
john doe
  • 9,220
  • 23
  • 91
  • 167
1
vote
1 answer

Chaining Multiple Query Filters in Vapor - Server Side Swift

We can apply a simple query filter in vapor with: // User is my model object connecting corresponding MySQL database table let aUser = try User.query().filter("user_email", "asd@example.com") How can we chain multiple query filters with AND or OR…
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
1
vote
1 answer

Is there anyway JSON(node: ) can be called with [String: Any] type in Vapor

I have a method, which will return a [String: Any] dictionary as below, func getDetailDictionary() -> [String: Any] { // demo code let followers = [1, 2, 3, 4, 5] return [ "name": "sample name", "followers": followers …
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
0
votes
1 answer

Server-Side Swift Development on MacOS with Xcode, Testing on Docker Ubuntu: How do I not clean/recreate each time?

Here's my development setup: On MacOS, I use Xcode to edit and build (but not run) my code (I build under Xcode/MacOS only to make sure I've got syntax errors out of the project). I use swift package generate-xcodeproj to create the Xcode project,…
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
0
votes
1 answer

Swift 5 Ubuntu 16.04 Crash with dateComponents

Here's my code: import Foundation if let utc = TimeZone(abbreviation: "UTC") { let calendar = Calendar.current print("\(calendar.description)") print("Before dateComponents") let componentsDate1 = calendar.dateComponents(in: utc,…
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
0
votes
1 answer

Unable to deploy Swift Vapor app in gCloud

I've a Swift Vapor app which works fine locally. I've tested the endpoints with Postman. When I try to deploy the app to Google Cloud, I get the following error. ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error: …
imthath
  • 1,353
  • 1
  • 13
  • 35
0
votes
1 answer

How to call mysql stored procedure in kitura application

I need to call MySQL stored procedures in kitura application and use it for the query result. how can I do that
Mac3n
  • 4,189
  • 3
  • 16
  • 29
0
votes
0 answers

Vapor app crashed on launching. VaporS3Signer.Provider.S3ProviderError.config("no vapor-S3Signer.json config file")

For serverside swift i am using vapor. Error on main.swift: Thread 1: Fatal error: Error raised at top level: VaporS3Signer.Provider.S3ProviderError.config("no vapor-S3Signer.json config file") log: Fatal error: Error raised at top level:…
Vvk
  • 4,031
  • 29
  • 51
0
votes
2 answers

Swift backend with perfct framwork

Hi i am learning Swift perfect backend i am stuck how to add mongodb dependencies in my project, If someone know how to do please help me import PackageDescription let package = Package( name: "SwiftBackend", products: [ …
0
votes
1 answer

Timer.scheduledTimer no available when using vapor?

I got this compile issue when compiling using vapor+Xcode: Below are some related info: $ vapor --version Vapor Toolbox: 3.1.7 Vapor Framework: 3.0.1 $ swift --version Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1) Target:…
Jay Zhao
  • 946
  • 10
  • 24
0
votes
1 answer

React-router multiple routes (React components)

Below are my routes.js that handles every request - this is for server side rendering in react - I have the following 2 files - I get hello world right now The main issue I have is - Where do i handle other routes? I am confused here this part -…
0
votes
2 answers

Server Side Swift with Perfect authentication and routes

I have server side swift project that is setup to upload files. And I am attempting to authentication to the project so that the files can only be accessed with a valid login. main.swift import PerfectLib import PerfectHTTP import…
MwcsMac
  • 6,810
  • 5
  • 32
  • 52
0
votes
1 answer

How to Cancel/Remove Redirecting the Client with Server side swift in perfect framework

In My Serverside swift demo, I have Redirecting to the Client. It's moved permenantly. How can I cancel redirection. I have used below code to redirect request. response.status = .movedPermanently response.setHeader(.location, value:…
Vvk
  • 4,031
  • 29
  • 51