Zeit.co 免费服务器平台

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_40254498/article/details/82426050

ZEIT.CO

  • 您可以轻松,快速,可靠地将JavaScript(Node.js)或Docker支持的网站,应用程序和服务带到云端。实际上,任何包含package.json或Dockerfile可以使用一个命令传输到云的目录:now。
  • 每次部署项目时,现在都会为您提供一个新的唯一URL(甚至在上传完成之前)。这些URL看起来像这样(为您自动确定应用程序的名称): 。在将部署投入生产时,您只需选择适当的别名(自定义域)。my-app my-app-erkgfjtrna.now.sh

简单部署

(我是用windows10 系统)
下载推荐使用的客户端 ,在macOS,Windows和Linux上通过npm或作为预先构建的二进制文件提供。但是,推荐的安装机制是Now Desktop(包括Now CLI,并确保它始终是最新的)。

将自己写好的静态网页放在一个文件夹里。

#  .\now-win.exe .\public\

PS E:\hexo\hexoblog> .\now-win.exe .\public\
> UPDATE AVAILABLE The latest version of Now CLI is 11.4.1
> Read more about how to update here: https://zeit.co/update-cli
> Deploying E:\hexo\hexoblog\public under pzwdshxzt
> Your deployment's code and logs will be publicly accessible because you are subscribed to the OSS plan.

> NOTE: You can use `now --public` or upgrade your plan (https://zeit.co/account/plan) to skip this prompt
> Synced 70 files (1.57MB) [12s]
> https://public-ehzfoxryxi.now.sh [in clipboard] [2s]
> Deployment complete!

看到这里就表示成功了。

每次部署都会是不一样的域名,域名也不是很好记,但是你可以用自己的域名部署上去。

删除部署

需要删除已经废弃的部署呢,也很简单

rm 命令可以删除

PS E:\hexo\hexoblog> .\now-win.exe rm https://public-athxetfvht.now.sh
> UPDATE AVAILABLE The latest version of Now CLI is 11.4.1
> Read more about how to update here: https://zeit.co/update-cli
> Found 1 deployment for removal in pzwdshxzt [1s]
> The following 1 deployment will be permanently removed:
  P4XeN5ZnH7skCRzvz4sa0piS      https://public-athxetfvht.now.sh      1m ago
> Are you sure? [y/N] y
> Success! 1 deployment removed [550ms]
- public-athxetfvht.now.sh

替换域名

使用 alias 将制定的部署包替换成 自己的域名

PS E:\hexo\hexoblog> .\now-win.exe alias https://public-fmqneyczqv.now.sh blog.dwxqnswxl.cn
> UPDATE AVAILABLE The latest version of Now CLI is 11.4.1
> Read more about how to update here: https://zeit.co/update-cli
> Assigning alias blog.dwxqnswxl.cn to deployment public-fmqneyczqv.now.sh
> Nameservers: f1g1ns1.dnspod.net, f1g1ns2.dnspod.net
> Error! We couldn't verify the domain dwxqnswxl.cn.

  Please make sure that your nameservers point to zeit.world.
  Examples: (full list at https://zeit.world)
    a.zeit.world        96.45.80.1
    b.zeit.world        46.31.236.1
    c.zeit.world        43.247.170.1

  As an alternative, you can add following records to your DNS settings:
    name        type         value
    _now        TXT          a5bddbba39391c47c4d754069f1442d136a1dca94680a56f007231732c1b1932
                ALIAS        alias.zeit.co

第一次失败了,体会提示你在你的域名解析该怎么填写,如上最后两行;
然后再域名解析中添加就好了
域名配置

然后再试下,就好了

PS E:\hexo\hexoblog> .\now-win.exe alias https://public-fmqneyczqv.now.sh blog.dwxqnswxl.cn
> UPDATE AVAILABLE The latest version of Now CLI is 11.4.1
> Read more about how to update here: https://zeit.co/update-cli
> Assigning alias blog.dwxqnswxl.cn to deployment public-fmqneyczqv.now.sh
> Certificate for blog.dwxqnswxl.cn (cert_aaGncmbkE1U2BhE) created [18s]
> Success! blog.dwxqnswxl.cn now points to public-fmqneyczqv.now.sh [21s]

Docker部署

常用命令

命令描述
now [path] …调用时now,当前目录中的文件将上载到Now,并将创建新的部署。之后,您将立即收到其网址,以便与全球其他人分享。该[path]可以是一个文件(导致静态部署)或目录(部署类型将根据内容来确定)。如果要一次部署多个路径,请阅读此内容。
now ls|list [app]显示所有部署的列表。如果[app]已定义,则仅列出该命名空间下的部署。
now rm|remove [id]从我们的平台中删除部署。该[id]参数可以是部署(例如网址https://static-ytbbrhoggd.now.sh或主机名(例如static-ytbbrhoggd.now.sh)。
now ln|alias [id] [url]我们为您配置现有部署的别名。您可以在此处阅读有关如何从此子命令中获取最多功能的更多信息。
now domains [name]允许您直接从命令行管理域名(在将它们用作别名之前)。
now certs [cmd]默认情况下,Now将自动为您的部署配置证书。使用此子命令,您可以看到它们何时到期并上传您自己的子命令
and so on
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值