-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"created VaporCoin from template https://github.com/vapor/api-template"
- Loading branch information
0 parents
commit 449c286
Showing
23 changed files
with
845 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# Created by https://www.gitignore.io/api/vapor | ||
|
||
### Vapor ### | ||
Config/secrets | ||
|
||
### Vapor Patch ### | ||
Packages | ||
.build | ||
xcuserdata | ||
*.xcodeproj | ||
DerivedData/ | ||
.DS_Store | ||
|
||
# End of https://www.gitignore.io/api/vapor |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
os: | ||
- linux | ||
- osx | ||
language: generic | ||
sudo: required | ||
dist: trusty | ||
|
||
osx_image: xcode8.3 | ||
before_install: | ||
- if [ $TRAVIS_OS_NAME == "osx" ]; then | ||
brew tap vapor/tap; | ||
brew update; | ||
brew install vapor; | ||
else | ||
eval "$(curl -sL https://apt.vapor.sh)"; | ||
sudo apt-get install vapor; | ||
sudo chmod -R a+rx /usr/; | ||
fi | ||
|
||
script: | ||
- swift build | ||
- swift build -c release | ||
- swift test | ||
|
||
after_success: | ||
- eval "$(curl -sL https://swift.vapor.sh/codecov)" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"foo": "foo-bar" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"hash": { | ||
"method": "sha256", | ||
"encoding": "hex", | ||
"key": "0000000000000000" | ||
}, | ||
|
||
"cipher": { | ||
"method": "aes256", | ||
"encoding": "base64", | ||
"key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"//": "The type of server to use for handling requests.", | ||
"//": "engine: Vapor's blazing fast Engine HTTP server.", | ||
"server": "engine", | ||
|
||
"//": "The type of client to use for requesting data from other services.", | ||
"//": "engine: Vapor's blazing fast Engine HTTP client.", | ||
"//": "foundation: A wrapper around Foundation's URLSession.", | ||
"client": "engine", | ||
|
||
"//": "The type of console to use for displaying information and prompting input.", | ||
"//": "terminal: Vapor's default terminal console.", | ||
"console": "terminal", | ||
|
||
"//": "The type of logger to use for recording logs, warnings, errors, etc.", | ||
"//": "console: Vapor's default logger sends logs directly to the chosen console.", | ||
"log": "console", | ||
|
||
"//": "The type of hasher to use for hashing messages.", | ||
"//": "crypto: Vapor's default hasher powered by OpenSSL (configure in crypto.json)", | ||
"//": "bcrypt: Performant BCrypt hashing implementation (configure in bcrypt.json)", | ||
"hash": "crypto", | ||
|
||
"//": "The type of cipher to use for encrypting and decrypting messages.", | ||
"//": "crypto: Vapor's default cipher powered by OpenSSL (configure in crypto.json)", | ||
"cipher": "crypto", | ||
|
||
"//": "Choose which middleware are enabled (and in which order).", | ||
"//": "error: Catches errors thrown in your application and returns a nice response.", | ||
"//": "date: Adds the 'Date' header to HTTP requests.", | ||
"//": "file: Catches 404 errors and checks for files in the Public/ folder", | ||
"middleware": [ | ||
"error", | ||
"date", | ||
"file" | ||
], | ||
|
||
"//": "Choose which commands this application can run", | ||
"//": "prepare: Supplied by the Fluent provider. Prepares the database (configure in fluent.json)", | ||
"commands": [ | ||
"prepare" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"//": "The underlying database technology to use.", | ||
"//": "memory: SQLite in-memory DB.", | ||
"//": "sqlite: Persisted SQLite DB (configure with sqlite.json)", | ||
"//": "Other drivers are available through Vapor providers", | ||
"//": "https://github.com/search?q=topic:vapor-provider+topic:database", | ||
"driver": "memory", | ||
|
||
"//": "Naming convention to use for creating foreign id keys,", | ||
"//": "e.g., `user_id`", | ||
"//": "`camelCase` option is also available.", | ||
"keyNamingConvention": "snake_case", | ||
|
||
"//": "Name of the table Fluent uses to track migrations.", | ||
"//": "If null, preparations will not be run.", | ||
"migrationEntityName": "fluent", | ||
|
||
"//": "Character used to join pivot tables, e.g., `user_pet`", | ||
"pivotNameConnector": "_", | ||
|
||
"//": "If true, foreign keys will automatically be added", | ||
"//": "to any `builder.foreignId(...)` calls.", | ||
"autoForeignKeys": true, | ||
|
||
"//": "Key to specify page number for paginated responses", | ||
"//": "e.g., `?page=2` ", | ||
"defaultPageKey": "page", | ||
|
||
"//": "Default page size if not otherwise specified on models", | ||
"defaultPageSize": 10, | ||
|
||
"//": "If true, all queries made to the database will be logged.", | ||
"log": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"//": "The $PORT:8080 call tells the json file to see if there", | ||
"//": "is any value at the 'PORT' environment variable.", | ||
"//": "If there is no value there, it will fallback to '8080'", | ||
"port": "$PORT:8080", | ||
|
||
"host": "0.0.0.0", | ||
|
||
"//": "It's very rare that a server manages its own TLS.", | ||
"//": "More commonly, vapor is served behind a proxy like nginx.", | ||
"securityLayer": "none" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"autoPin": true, | ||
"pins": [ | ||
{ | ||
"package": "BCrypt", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/bcrypt.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Bits", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/bits.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "CTLS", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/ctls.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Console", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/console.git", | ||
"version": "2.1.0" | ||
}, | ||
{ | ||
"package": "Core", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/core.git", | ||
"version": "2.0.2" | ||
}, | ||
{ | ||
"package": "Crypto", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/crypto.git", | ||
"version": "2.0.0" | ||
}, | ||
{ | ||
"package": "Debugging", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/debugging.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Engine", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/engine.git", | ||
"version": "2.0.4" | ||
}, | ||
{ | ||
"package": "Fluent", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/fluent.git", | ||
"version": "2.1.0" | ||
}, | ||
{ | ||
"package": "FluentProvider", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/fluent-provider.git", | ||
"version": "1.1.1" | ||
}, | ||
{ | ||
"package": "JSON", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/json.git", | ||
"version": "2.0.2" | ||
}, | ||
{ | ||
"package": "Multipart", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/multipart.git", | ||
"version": "2.0.0" | ||
}, | ||
{ | ||
"package": "Node", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/node.git", | ||
"version": "2.0.3" | ||
}, | ||
{ | ||
"package": "Random", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/random.git", | ||
"version": "1.0.0" | ||
}, | ||
{ | ||
"package": "Routing", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/routing.git", | ||
"version": "2.0.0" | ||
}, | ||
{ | ||
"package": "SQLite", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/sqlite.git", | ||
"version": "2.0.0" | ||
}, | ||
{ | ||
"package": "Sockets", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/sockets.git", | ||
"version": "2.0.1" | ||
}, | ||
{ | ||
"package": "TLS", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/tls.git", | ||
"version": "2.0.4" | ||
}, | ||
{ | ||
"package": "Vapor", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/vapor/vapor.git", | ||
"version": "2.1.0" | ||
} | ||
], | ||
"version": 1 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "VaporCoin", | ||
targets: [ | ||
Target(name: "App"), | ||
Target(name: "Run", dependencies: ["App"]), | ||
], | ||
dependencies: [ | ||
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2), | ||
.Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1) | ||
], | ||
exclude: [ | ||
"Config", | ||
"Database", | ||
"Localization", | ||
"Public", | ||
"Resources", | ||
] | ||
) | ||
|
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<p align="center"> | ||
<img src="https://cloud.githubusercontent.com/assets/1342803/24797159/52fb0d88-1b90-11e7-85a5-359fff0496a4.png" width="320" alt="MySQL"> | ||
<br> | ||
<br> | ||
<a href="http://beta.docs.vapor.codes/getting-started/hello-world/"> | ||
<img src="http://img.shields.io/badge/read_the-docs-92A8D1.svg" alt="Documentation"> | ||
</a> | ||
<a href="http://vapor.team"> | ||
<img src="http://vapor.team/badge.svg" alt="Slack Team"> | ||
</a> | ||
<a href="LICENSE"> | ||
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License"> | ||
</a> | ||
<a href="https://circleci.com/gh/vapor/mysql"> | ||
<img src="https://circleci.com/gh/vapor/mysql.svg?style=shield" alt="Continuous Integration"> | ||
</a> | ||
<a href="https://travis-ci.org/vapor/api-template"> | ||
<img src="https://travis-ci.org/vapor/api-template.svg?branch=master" alt="Build Status"> | ||
</a> | ||
<a href="https://swift.org"> | ||
<img src="http://img.shields.io/badge/swift-3.1-brightgreen.svg" alt="Swift 3.1"> | ||
</a> | ||
</center> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import FluentProvider | ||
|
||
extension Config { | ||
public func setup() throws { | ||
// allow fuzzy conversions for these types | ||
// (add your own types here) | ||
Node.fuzzy = [Row.self, JSON.self, Node.self] | ||
|
||
try setupProviders() | ||
try setupPreparations() | ||
} | ||
|
||
/// Configure providers | ||
private func setupProviders() throws { | ||
try addProvider(FluentProvider.Provider.self) | ||
} | ||
|
||
/// Add all models that should have their | ||
/// schemas prepared before the app boots | ||
private func setupPreparations() throws { | ||
preparations.append(Post.self) | ||
} | ||
} |
Oops, something went wrong.