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 HTTP | |
import Vapor | |
import Fluent | |
import Foundation | |
struct User: Model { | |
var id: Node? | |
var name: String | |
var created_at: Int | |
var updated_at: Int |
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 Vapor | |
import Fluent | |
struct User: Model { | |
var id: Node? | |
init(node: Node, in context: Context) throws { | |
id = try node.extract("id") | |
} | |
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 XCTest | |
func expect<E: Error, ReturnType>( | |
toThrow expectedError: E, | |
file: StaticString = #file, | |
line: UInt = #line, | |
from closure: (Void) throws -> ReturnType | |
) where E: Equatable { | |
do { | |
let _ = try closure() |
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
#limit requests to 3 per second | |
limit_req_zone $binary_remote_addr zone=login:10m rate=3r/s; | |
#https reverse proxy | |
server { | |
listen 443; | |
server_name alpha.brett-toomey.com; | |
ssl_certificate /etc/letsencrypt/live/alpha.brett-toomey.com/cert.pem; | |
ssl_certificate_key /etc/letsencrypt/live/alpha.brett-toomey.com/privkey.pem; |
NewerOlder