{"id":17832,"date":"2020-02-04T07:30:53","date_gmt":"2020-02-03T23:30:53","guid":{"rendered":"http:\/\/4563.org\/?p=17832"},"modified":"2020-02-04T07:30:53","modified_gmt":"2020-02-03T23:30:53","slug":"%e8%bd%ac%e8%bd%bd%e5%88%a9%e7%94%a8-now-sh-%e9%83%a8%e7%bd%b2%e4%ba%91%e5%87%bd%e6%95%b0-onepoint-vps%e8%b5%84%e8%ae%af","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=17832","title":{"rendered":"[\u8f6c\u8f7d]\u5229\u7528 now.sh \u90e8\u7f72\u4e91\u51fd\u6570 OnePoint &#8211; VPS\u8d44\u8baf"},"content":{"rendered":"<br \/>\n<h3>\u8f6c\u8f7d<\/h3>\n<p>\u8f6c\u8f7d\u81ea <a href=\"https:\/\/www.onesrc.cn\/p\/deploy-cloud-function-onepoint-with-nowsh-serverless.html\">https:\/\/www.onesrc.cn\/p\/deploy-cloud-function-onepoint-with-nowsh-serverless.html<\/a><\/p>\n<h3>\u6b63\u6587<\/h3>\n<p>\u5229\u7528 now.sh serverless \u90e8\u7f72\u4e91\u51fd\u6570 OnePoint<\/p>\n<p>\u7b2c\u4e00\u6b21\u63a5\u89e6\u5230\u4e91\u51fd\u6570\u662f\u5728\u817e\u8baf\u4e91\uff0c\u7531\u4e8e\u662f\u56fd\u5185\u670d\u52a1\u5546\uff0c\u5ba2\u670d\u5728\u7ebf\u3001\u5f00\u53d1\u70ed\u5fc3\u3001\u8bbf\u95ee\u901f\u5ea6\u5feb\u3001\u800c\u4e14\u6709\u4e00\u5b9a\u7684\u514d\u8d39\u989d\u5ea6\uff0c\u6574\u4f53\u4f53\u9a8c\u8fd8\u4e0d\u9519\u3002\u4f46\u662f\u81ea 2019 \u5e74 12 \u6708\u8d77\uff0c\u817e\u8baf\u4e91\u7f51\u5173\u670d\u52a1\u5f00\u59cb\u6536\u8d39\uff0c\u5bf9\u4e8e\u4e2a\u4eba\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u4e91\u51fd\u6570\u4f7f\u7528\u8d77\u6765\u5c31\u6ca1\u6709\u90a3\u4e48\u8212\u670d\u4e86\u3002\u4e3a\u4e86\u589e\u5f3a OnePoint \u9879\u76ee\u7684\u5e73\u53f0\u65e0\u5173\u6027\uff0c\u6211\u4fbf\u7ffb\u51fa\u4e86\u96ea\u85cf\u5df2\u4e45\u7684 now.sh\uff0c\u53c8\u5bf9 OnePoint \u9879\u76ee\u505a\u4e86\u9002\u914d\u3002<\/p>\n<h3>Now.sh \u4ecb\u7ecd<\/h3>\n<p>Now.sh \u662f ZEIT \u63a8\u51fa\u7684\u4e00\u6b3e\u652f\u6301 Docker\u3001Nodejs\u3001\u9759\u6001\u9875\u9762\u7684\u5168\u7403\u5316\u5b9e\u65f6\u90e8\u7f72\u670d\u52a1\uff08 Realtime Global Deployments \uff09<\/p>\n<p>\u66f4\u591a\u7ec6\u8282\u5185\u5bb9\u53c2\u89c1\u5b98\u7f51 <a href=\"https:\/\/zeit.co\/\">https:\/\/zeit.co\/<\/a>\u3002<\/p>\n<h3>\u514d\u8d39\u5957\u9910<\/h3>\n<p>\u652f\u6301 https\u3001\u81ea\u5b9a\u4e49\u57df\u540d<br \/>\u652f\u6301 Github \u90e8\u7f72<br \/>\u652f\u6301 \u667a\u80fd cdn<br \/>\u4e0d\u9650\u989d\u5ea6\u7684 Websites \u548c api<br \/>\u652f\u6301 Node.js, Go \u7b49\u4e91\u51fd\u6570<\/p>\n<h3>\u514d\u8d39\u989d\u5ea6<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/20200204_5e38ef10856a4.png\" title=\"\u514d\u8d39\u989d\u5ea6\" alt=\"[\u8f6c\u8f7d]\u5229\u7528 now.sh \u90e8\u7f72\u4e91\u51fd\u6570 OnePoint - VPS\u8d44\u8baf\"><\/p>\n<h3>\u5b89\u88c5\u90e8\u7f72<\/h3>\n<p>\u6ce8\u518c\u8d26\u53f7<br \/><a href=\"https:\/\/zeit.co\/\">https:\/\/zeit.co\/<\/a><\/p>\n<h3>\u5b89\u88c5 CLI<\/h3>\n<p>\u5b89\u88c5 Nodejs<br \/>now.sh \u7684\u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u662f\u57fa\u4e8e nodejs \u7684\uff0c\u6240\u4ee5\u9996\u5148\u5b89\u88c5 nodejs \u73af\u5883\u3002<\/p>\n<p>Nodejs \u5b98\u65b9\u5730\u5740\uff1a<a href=\"https:\/\/nodejs.org\/en\/download\/\">https:\/\/nodejs.org\/en\/download\/<\/a><\/p>\n<p>\u4e0b\u8f7d\u540e\u81ea\u884c\u8fd0\u884c\u5b89\u88c5\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002<\/p>\n<p>\u6253\u5f00 cmd \u547d\u4ee4\u884c\u7ec8\u7aef\uff0c\u8f93\u5165 npm &#8211;version \u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6b63\u786e\u3002<\/p>\n<pre><code>C:Users15591Desktop $ npm --version 6.9.0<\/code><\/pre>\n<h3>\u5b89\u88c5 now.sh \u5ba2\u6237\u7aef<\/h3>\n<pre><code>npm install -g now<\/code><\/pre>\n<h3>\u767b\u5f55<\/h3>\n<p>\u6253\u5f00 cmd \u547d\u4ee4\u884c\u7ec8\u7aef\uff0c\u8f93\u5165<\/p>\n<pre><code>now login<\/code><\/pre>\n<p>\u8f93\u5165\u4f60\u7684\u90ae\u7bb1\uff0c\u6536\u5230\u90ae\u4ef6\u540e\u786e\u8ba4\u767b\u5f55\u3002<\/p>\n<h3>\u914d\u7f6e\u6587\u4ef6<\/h3>\n<ol>\n<li>\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939 point<\/li>\n<li>\u5728 point \u6587\u4ef6\u5939\u4e0b\u65b0\u5efa api \u6587\u4ef6\u5939<\/li>\n<li>\u4e0b\u8f7d OnePoint <a href=\"https:\/\/github.com\/ukuq\/onepoint\/archive\/master.zip\">https:\/\/github.com\/ukuq\/onepoint\/archive\/master.zip<\/a><\/li>\n<li>\u89e3\u538b\uff0c\u5c06\u6587\u4ef6\u653e\u7f6e\u5230 api \u6587\u4ef6\u5939\u4e0b<\/li>\n<li>\u4fee\u6539 config.json \u6587\u4ef6\u3002\u914d\u7f6e\u65b9\u5f0f\u53c2\u8003 <a href=\"https:\/\/www.onesrc.cn\/p\/onepoint-configuration-process.html\">https:\/\/www.onesrc.cn\/p\/onepoint-configuration-process.html<\/a><\/li>\n<li>\u5728 point \u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2a now.json \u6587\u4ef6<\/li>\n<\/ol>\n<pre><code>{     &quot;name&quot;: &quot;onepoint&quot;,     &quot;version&quot;: 2,     &quot;env&quot;: {         &quot;point_env&quot;: &quot;now&quot;     },     &quot;functions&quot;: {         &quot;api\/bin\/index_now.js&quot;: {             &quot;maxDuration&quot;: 10         }     },     &quot;regions&quot;: [         &quot;sin1&quot;,         &quot;icn1&quot;,         &quot;hnd1&quot;     ],     &quot;routes&quot;: [         {             &quot;src&quot;: &quot;\/.*&quot;,             &quot;dest&quot;: &quot;api\/bin\/index_now.js&quot;         }     ] }<\/code><\/pre>\n<h3>\u90e8\u7f72\u81f3 now<\/h3>\n<p>\u6253\u5f00cmd \u547d\u4ee4\u884c\uff0c\u8fdb\u5165\u5230 point \u6587\u4ef6\u5939\uff0c\u6267\u884c now \u547d\u4ee4<\/p>\n<pre><code>$ now &gt; Deploying ~MyFilesWorkSpaceGitpoint under ukuq &gt; Using project onepoint &gt; Synced 2 files [3s] &gt; https:\/\/onepoint-lxjh2xlj9.now.sh [8s] &gt; Ready! Deployed to https:\/\/onepoint.ukuq.now.sh [in clipboard] [42s]<\/code><\/pre>\n<h3>\u90e8\u7f72\u6210\u529f<\/h3>\n<p><code>https:\/\/onepoint.ukuq.now.sh<\/code><\/p>\n<div style=\"padding: 10px 0; margin: 20px auto; width: 100%; font-size:16px; text-align: center;\">      <button disable=\"enable\" onclick=\"var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}\">          <span>\u6253\u8d4f<\/span><\/button>      <\/p>\n<div style=\"display: none;\">\n<div style=\"display: inline-block\">              <a rel=\"group\">                  <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/20200204_5e38ef132c79a.jpg\" alt=\"[\u8f6c\u8f7d]\u5229\u7528 now.sh \u90e8\u7f72\u4e91\u51fd\u6570 OnePoint - VPS\u8d44\u8baf\"><\/a>              <\/p>\n<p>\u5fae\u4fe1\u6253\u8d4f<\/p>\n<\/p><\/div>\n<div style=\"display: inline-block\">              <a rel=\"group\">                  <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/20200204_5e38ef16e7157.jpg\" alt=\"[\u8f6c\u8f7d]\u5229\u7528 now.sh \u90e8\u7f72\u4e91\u51fd\u6570 OnePoint - VPS\u8d44\u8baf\"><\/a>              <\/p>\n<p>\u652f\u4ed8\u5b9d\u6253\u8d4f<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d \u8f6c\u8f7d\u81ea https:\/\/ww&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/17832"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17832"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/17832\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17832"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}