• 使用perfect进行服务端开发


    最近闲来无事,研究了下基于perfect的swift后端开发。根据大神的博客进行了简单的配置,加深下印象也算是和各位分享一下。

    参考博客:http://www.cnblogs.com/ludashi  各位可移步仔细研究下,他写的已经相当详细,结合perfect的文档,很容易上手

    perfect文档可移步至  https://github.com/PerfectlySoft/PerfectDocs/blob/master/README.zh_CN.md

    1、服务器配置

    我们使用官方给定的模板进行代码的编辑:https://github.com/PerfectlySoft/PerfectTemplate

    根据官网的指示在终端进行如下的操作:

    git clone https://github.com/PerfectlySoft/PerfectTemplate.git  //下载模板代码
    cd PerfectTemplate      //进入模板
    swift build   //编译
    .build/debug/PerfectTemplate  //在debug模式下开启服务

    在终端可看到以下输出则配置成功:

    [INFO] Starting HTTP server localhost on 0.0.0.0:8181
    [INFO] Starting HTTP server localhost on 0.0.0.0:8080

    在浏览器输入 http://localhost:8181/ 或者127.0.0.1:8181可进行简单的get请求
    关闭服务器服务可使用 control+c 进行关闭

    2、生成Xcode项目
    使用 swift packge generate-xcodeproj 生成一个Xcode执行项目,可使用Xcode进行代码的编辑工作
  • 相关阅读:
    Siteserver平台搭建
    Android快速入门
    Android Studio/IntelliJ IDEA使用手记
    Nook 2 Root
    Spring 小记
    DeepinXP Lite 6.2 精简版220M 安装IIS
    Rom Modified [Galaxy 3 Tested]
    Windows Thin PC体验 & 语言包更改(win 7 included)
    重装系统后恢复wubi安装的Ubuntu(未实测)
    20180822-Java接口
  • 原文地址:https://www.cnblogs.com/lidarui/p/6801679.html
Copyright © 2020-2023  润新知