GitHub - Jinxiansen/SwiftServerSide-Vapor: Swift server open source projects bas...
source link: https://github.com/Jinxiansen/SwiftServerSide-Vapor
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
English version
简述
这是基于 Swift 4.1 和 Vapor 3 框架的 Swift 服务端开源项目,目前文档列举的 API 已经部署在正式环境应用中,后续有新增会不断完善。
项目部署在 http://api.jinxiansen.com
查看? 目前已完成的 API 示例文档并调试。
查看✍️ Vapor 的一些基本用法。
另: 这里有几个 Vapor 部署的 H5 页面示例,你可以点击查看效果。
Keyboard Reboot Login Loader Color Line
使用
运行项目前的前期工作: 点击 Clone or download 下载项目。
-
基于 macOS 环境,需要安装 Xcode、 Vapor 3、MySQL 。
-
基于 Linux 环境,需要安装 Swift 4.1、 vapor 3、MySQL 。
以上 Vapor 和 MySQL 安装完成后, 需要在终端以 Root 身份进入 MySQL ,执行以下命令:
-
创建 Debug 模式下的数据库:
create database vaporDebugDB character set utf8mb4;
-
创建 Release 模式下的数据库:
create database vaporDB character set utf8mb4;
-
创建项目中用到的数据库登录用户:
grant all privileges on *.* to sqluser@"%" identified by "qwer1234" with grant option;
ok,现在打开终端,依次执行:
cd
到VaporServer
- 执行
vapor build && vapor run
- 当你看到 Server starting on http: //localhost:8080 的时候,便是已经运行成功了!
- 此时可以 查看 目前已完成的 API 示例文档并调试。
提示:在 macOS 上 可以通过
vapor xcode -y
生成 Xcode 项目进行开发和调试。
反馈
如果有任何问题或建议,可以提一个 Issue
Email : @JinXiansen
Twitter : @Jinxiansen
License ?
SwiftServerSide-Vapor is released under the MIT license. See LICENSE for details.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK