This file contains hidden or 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 Leaf | |
try services.register(LeafProvider()) | |
config.prefer(LeafRenderer.self, for: ViewRenderer.self) |
This file contains hidden or 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 FluentPostgreSQL | |
try services.register(FluentPostgreSQLProvider()) | |
/// Register the configured SQLite database to the database config. | |
var databases = DatabasesConfig() | |
let databaseConfig = PostgreSQLDatabaseConfig(hostname: "localhost", username: "postgres", database: "blog") | |
let database = PostgreSQLDatabase(config: databaseConfig) |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
Hello World | |
</body> | |
</html> |
This file contains hidden or 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 Vapor | |
/// Register your application's routes here. | |
public func routes(_ router: Router) throws { | |
router.get("movies") { request in | |
return "movies" | |
} | |
} |
This file contains hidden or 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 Vapor | |
/// Register your application's routes here. | |
public func routes(_ router: Router) throws { | |
router.get("movies") { request in | |
return "movies" | |
} | |
router.get("movies/fiction/1992") { request in |
This file contains hidden or 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
router.get("movies",String.parameter) { request -> String in | |
let genre = try request.parameters.next(String.self) | |
return "Movie with genre \(genre)" | |
} |
This file contains hidden or 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
// | |
// ViewController.swift | |
// NailasCoffee | |
// | |
// Created by Mohammad Azam on 6/28/18. | |
// Copyright © 2018 Mohammad Azam. All rights reserved. | |
// | |
import UIKit | |
import Intents |
This file contains hidden or 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
// | |
// IntentHandler.swift | |
// OrderCoffeeIntent | |
// | |
// Created by Mohammad Azam on 6/29/18. | |
// Copyright © 2018 Mohammad Azam. All rights reserved. | |
// | |
import Intents |
This file contains hidden or 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
const mongoose = require('mongoose') | |
// definining the schema for the dish | |
let dishSchema = mongoose.Schema({ | |
name :String, | |
price : Number, | |
imageURL :String | |
}) | |
This file contains hidden or 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
const mongoose = require('mongoose') | |
let reviewSchema = mongoose.Schema({ | |
title : String, | |
description :String, | |
dishId : mongoose.Schema.ObjectId | |
}) | |
const Review = mongoose.model('Review',reviewSchema) |