美文网首页swift编程开发
如何在阿里云上部署Perfect服务器

如何在阿里云上部署Perfect服务器

作者: 师霖风 | 来源:发表于2017-08-21 22:46 被阅读347次

相关文章

网友评论

  • Sunshine_Boys:如何 在Perfect的基础上请求第三方服务器呢
    师霖风:参考一下https://github.com/PerfectlySoft/Perfect-CURL
    一个post请求的使用例子
    func request(responseJSON:(([String:Any])->())? = nil,responseError:((Error)->())? = nil) {
    let url = ""
    let postString = ""

    let request = CURLRequest.init(url, options: [.postString(postString)])
    request.perform {
    confirmation in
    do {
    let response = try confirmation()
    let json: [String:Any] = response.bodyJSON
    if let block = responseJSON {
    block(json)
    }
    print(json)
    } catch let error as CURLResponse.Error {
    if let block = responseError {
    block(error)
    }
    print("出错,响应代码为: \(error.response.responseCode)")
    } catch {
    print("致命错误: \(error)")
    }
    }
    }
  • 097a14a11101:感谢lz, 遇到不少问题, 不过都是小坑, 比方说新装的系统, 要先执行: sudo apt-get update

    请假lz一个问题: 我运行成功了, [INFO] Starting HTTP server localhost on 0.0.0.0:8181

    可以公网 IP 加端口, 无法访问呀?

    求解?
    师霖风:@白熊汇率 不需要,在mac OS上也可以运行,而且xcode自带swift工具链
    fd5657ed541e:mac OS 开发 还要 Ubuntu 吗
    097a14a11101:安全规则的问题, demo默认的 8181 没开放权限, 现在好了 ~

本文标题:如何在阿里云上部署Perfect服务器

本文链接:https://www.haomeiwen.com/subject/uozhdxtx.html