|
1 |
| -# Perfect Turnstile with MySQL [简体中文](README.zh_CN.md) |
2 |
| - |
3 |
| -<p align="center"> |
4 |
| - <a href="http://perfect.org/get-involved.html" target="_blank"> |
5 |
| - <img src="http://perfect.org/assets/github/perfect_github_2_0_0.jpg" alt="Get Involed with Perfect!" width="854" /> |
6 |
| - </a> |
7 |
| -</p> |
8 |
| - |
9 |
| -<p align="center"> |
10 |
| - <a href="https://github.com/PerfectlySoft/Perfect" target="_blank"> |
11 |
| - <img src="http://www.perfect.org/github/Perfect_GH_button_1_Star.jpg" alt="Star Perfect On Github" /> |
12 |
| - </a> |
13 |
| - <a href="http://stackoverflow.com/questions/tagged/perfect" target="_blank"> |
14 |
| - <img src="http://www.perfect.org/github/perfect_gh_button_2_SO.jpg" alt="Stack Overflow" /> |
15 |
| - </a> |
16 |
| - <a href="https://twitter.com/perfectlysoft" target="_blank"> |
17 |
| - <img src="http://www.perfect.org/github/Perfect_GH_button_3_twit.jpg" alt="Follow Perfect on Twitter" /> |
18 |
| - </a> |
19 |
| - <a href="http://perfect.ly" target="_blank"> |
20 |
| - <img src="http://www.perfect.org/github/Perfect_GH_button_4_slack.jpg" alt="Join the Perfect Slack" /> |
21 |
| - </a> |
22 |
| -</p> |
23 |
| - |
24 |
| -<p align="center"> |
25 |
| - <a href="https://developer.apple.com/swift/" target="_blank"> |
26 |
| - <img src="https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat" alt="Swift 3.0"> |
27 |
| - </a> |
28 |
| - <a href="https://developer.apple.com/swift/" target="_blank"> |
29 |
| - <img src="https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat" alt="Platforms OS X | Linux"> |
30 |
| - </a> |
31 |
| - <a href="http://perfect.org/licensing.html" target="_blank"> |
32 |
| - <img src="https://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat" alt="License Apache"> |
33 |
| - </a> |
34 |
| - <a href="http://twitter.com/PerfectlySoft" target="_blank"> |
35 |
| - <img src="https://img.shields.io/badge/[email protected]?style=flat" alt="PerfectlySoft Twitter"> |
36 |
| - </a> |
37 |
| - <a href="http://perfect.ly" target="_blank"> |
38 |
| - <img src="http://perfect.ly/badge.svg" alt="Slack Status"> |
39 |
| - </a> |
40 |
| -</p> |
41 |
| - |
42 |
| - |
43 |
| -This example demonstrates the integration Stormpath's Turnstile authentication system with Perfect and a MySQL ORM. |
44 |
| - |
45 |
| -The library can be found at [https://github.com/PerfectlySoft/Perfect-Turnstile-MySQL](https://github.com/PerfectlySoft/Perfect-Turnstile-MySQL) |
46 |
| - |
47 |
| -This package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project. |
48 |
| - |
49 |
| -Ensure you have installed Xcode 8.0 or later. |
50 |
| - |
51 |
| -## Build Notes |
52 |
| - |
53 |
| -### macOS |
54 |
| - |
55 |
| -Requires the use of Homebrew’s MySQL. |
56 |
| - |
57 |
| -``` |
58 |
| -brew install mysql |
59 |
| -``` |
60 |
| - |
61 |
| -If you need Homebrew, you can install it with: |
62 |
| - |
63 |
| -``` |
64 |
| -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
65 |
| -``` |
66 |
| - |
67 |
| -Unfortunately, at this point in time you will need to edit the mysqlclient.pc file located here: |
68 |
| - |
69 |
| -``` |
70 |
| -/usr/local/lib/pkgconfig/mysqlclient.pc |
71 |
| -``` |
72 |
| - |
73 |
| -Remove the occurrence of "-fno-omit-frame-pointer". This file is read-only by default so you will need to change that first. |
74 |
| - |
75 |
| -### Linux |
76 |
| - |
77 |
| -Ensure that you have installed libmysqlclient-dev for MySQL version 5.6 or greater: |
78 |
| - |
79 |
| -``` |
80 |
| -sudo apt-get install libmysqlclient-dev |
81 |
| -``` |
82 |
| - |
83 |
| -Please note that Ubuntu 14 defaults to including a version of MySQL client which will not compile with this package. Install MySQL client version 5.6 or greater manually. |
84 |
| - |
85 |
| - |
86 |
| -## Setup - Xcode 8 |
87 |
| - |
88 |
| -* Check out or download the project; |
89 |
| -* In terminal, navigate to the directory and execute |
90 |
| - |
91 |
| -``` |
92 |
| -swift package generate-xcodeproj |
93 |
| -``` |
94 |
| - |
95 |
| -* Open `PerfectTurnstile MySQL Demo.xcodeproj` |
96 |
| - |
97 |
| -To run this project from Xcode, edit the Scheme, Under "Options" for "run", check "Use custom working directory" and choose the project's working directory. After doing this, the project can be run from within Xcode. |
98 |
| - |
99 |
| -## Setup - Terminal |
100 |
| - |
101 |
| -* Check out or download the project; |
102 |
| -* In terminal, navigate to the directory |
103 |
| -* Execute `swift build` |
104 |
| -* Once the project has compiled, execute `./.build/debug/PerfectTurnstile MySQL Demo` |
105 |
| - |
106 |
| -``` |
107 |
| -[INFO] Starting HTTP server on 0.0.0.0:8181 with document root ./webroot |
108 |
| -``` |
109 |
| - |
110 |
| - |
111 |
| -## Included JSON Routes |
112 |
| - |
113 |
| -The framework includes certain basic routes: |
114 |
| - |
115 |
| -``` |
116 |
| -POST /api/v1/login (with username & password form elements) |
117 |
| -POST /api/v1/register (with username & password form elements) |
118 |
| -GET /api/v1/logout |
119 |
| -``` |
120 |
| - |
121 |
| -## Included Routes for Browser |
122 |
| - |
123 |
| -The following routes are available for browser testing: |
124 |
| - |
125 |
| -``` |
126 |
| -http://localhost:8181 |
127 |
| -http://localhost:8181/login |
128 |
| -http://localhost:8181/register |
129 |
| -``` |
130 |
| - |
131 |
| -These routes are using Mustache files in the webroot directory. |
132 |
| - |
| 1 | +THIS PACKAGE IS OBSOLETE AND SHOULD NOT BE USED FOR NEW PROJECTS. |
0 commit comments