This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppKit | |
class Game: NSObject { | |
var id: Int? | |
var desc: String? | |
var title: String? | |
var releaseDate: String? | |
override init(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfectLib | |
import PerfectHTTP | |
import PerfectHTTPServer | |
import PerfectMySQL | |
import Foundation | |
let server = HTTPServer() | |
var routes = Routes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfectLib | |
import PerfectHTTP | |
import PerfectHTTPServer | |
import PerfectMySQL | |
import Foundation | |
let mysql = DB() | |
mysql.insertGame(title: "testing", description: "testing", createdDate: "1991-05-31"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfectHTTP | |
import PerfectHTTPServer | |
import PerfectMySQL | |
import Foundation | |
public class DB { | |
// You'll need to update these values based on how you've set up MySQL. | |
let host = "127.0.0.1" | |
let user = "root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfectLib | |
import PerfectHTTP | |
import PerfectHTTPServer | |
import PerfectMySQL | |
import Foundation | |
// You'll need to update these values based on how you've set up MySQL. | |
let host = "127.0.0.1" | |
let user = "root" | |
let password = "admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DB { | |
// You'll need to update these values based on how you've set up MySQL. | |
let host = "127.0.0.1" | |
let user = "root" | |
let password = "admin" | |
let database = "nintendo" | |
func databaseConnect(host: String, user: String, password: String, db: String) -> MySQL { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PackageDescription | |
let package = Package( | |
name: "swift-server", | |
dependencies: [ | |
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2), | |
.Package(url:"https://github.com/PerfectlySoft/Perfect-MySQL.git", majorVersion: 3) | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfectLib | |
import PerfectHTTP | |
import PerfectHTTPServer | |
print("Hello, world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PackageDescription | |
let package = Package( | |
name: "swift-server", | |
dependencies: [ | |
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2) | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import ChameleonFramework | |
class RootViewController: UIViewController { | |
@IBOutlet var myImage: UIImageView! | |
@IBOutlet var myTitle: UILabel! | |
@IBOutlet var myDescription: UITextView! | |
override func viewDidLoad() { | |
super.viewDidLoad() |
NewerOlder