zoukankan      html  css  js  c++  java
  • 【Swift后台】环境安装

    macOS

    在macOS上使用Vapor,需要Xcode 9.3或更高版本、Swift 4.1或更高版本。安装还需要Homebrew命令。

    检查Swift版本:

    swift --version

    Vapor安装命令:

    brew tap vapor/tap
    brew install vapor/tap/vapor

    检查安装完成

    vapor --help

    Ubuntu

    支持Vapor和Swift的Ubuntu版本:

    VersionCodename
    18.10 Cosmic Cuttlefish
    18.04 Bionic Beaver
    16.10 Yakkety Yak
    16.04 Xenial Xerus
    14.04 Trusty Tahr

    使用这个方便的脚本轻松添加Vapor的APT仓库。

    eval "$(curl -sL https://apt.vapor.sh)"

    此命令需要curl使用可以安装的命令sudo apt-get install curl

    Dockerfile 

    从Dockerfile配置Ubuntu时,可以通过以下命令添加APT repo:

    RUN /bin/bash -c "$(wget -qO- https://apt.vapor.sh)"

    Manual

    或者手动添加

    wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | sudo apt-key add -
    echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vapor.list
    sudo apt-get update

    安装

    现在您已经添加了Vapor的APT存储库,您可以安装所需的依赖项。

    sudo apt-get install swift vapor

    检查安装

    Vapor需要Swift 4.1或更高版本。

    swift --version

    Vapor

    vapor --help

    上一篇【Swift后台】背景介绍

    下一篇

    目   录

  • 相关阅读:
    filter 静态资源
    getRequestURI,getRequestURL的区别
    基于NodeJs的网页爬虫的构建(二)
    基于NodeJs的网页爬虫的构建(一)
    Reverse Words in a String
    Sum Root to Leaf Numbers
    Search Insert Position
    Wildcard Matching
    Trapping Rain Water
    Gray Code
  • 原文地址:https://www.cnblogs.com/vlucht/p/11357741.html
Copyright © 2011-2022 走看看