微信小程序-京東購物系列一

 

一.node-js後臺服務器建立

https://mlab.com/  monggoDb數據庫javascript

https://www.heroku.com node後臺服務器java

 

二.後臺關聯

1.keys.js node

monggoDb數據關聯git

module.exports = {
  mongoURI: 'mongodb://user:password@ds223542.mlab.com:23542/taxware-api',
  secretOrKey: 'secret'
};

  

2.node後臺上傳heroku服務器web

首先下載安裝heroku-cli工具mongodb

https://devcenter.heroku.com/articles/heroku-cli數據庫

1.後臺代碼git到本地倉庫npm

2.命令行中上傳代碼到heroku服務器 json

命令以下:小程序

PS C:\Users\Administrator\Desktop\jd-interface> heroku login    //命令中登陸heroku
heroku: Press any key to open up the browser to login or q to exit:
 »   Warning: If browser does not open, visit
 »   https://cli-auth.heroku.com/auth/browser/d33e41e0-4afe-4ad4-8c2e-64968973f718
Logging in... done
Logged in as sjxajhhaozi@foxmail.com //登陸成功標誌

PS C:\Users\Administrator\Desktop\jd-interface> heroku create  //建立服務器應用
Creating app... done, ⬢ shrouded-headland-66332  //建立後的應用名字
https://shrouded-headland-66332.herokuapp.com/ | https://git.heroku.com/shrouded-headland-66332.git
PS C:\Users\Administrator\Desktop\jd-interface> heroku git:remote -a shrouded-headland-66332  //本地git倉庫關聯heroku
set git remote heroku to https://git.heroku.com/shrouded-headland-66332.git
PS C:\Users\Administrator\Desktop\jd-interface> git push heroku master  //後臺代碼上傳到heroku
Enumerating objects: 200, done.
Counting objects: 100% (200/200), done.
Delta compression using up to 4 threads
Compressing objects: 100% (181/181), done.
Writing objects: 100% (200/200), 41.27 KiB | 358.00 KiB/s, done.
Total 200 (delta 73), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version 10.x...
remote:        Downloading and installing node 10.13.0...
remote:        Using default npm version: 6.4.1
remote:
remote: -----> Building dependencies
remote:        Installing node modules (package.json + package-lock)
remote:
remote:        > bcrypt@2.0.1 install /tmp/build_6e5670a3cba76a8761ecd1e7cf3f0284/node_modules/bcrypt
remote:        > node-pre-gyp install --fallback-to-build
remote:
remote:        [bcrypt] Success: "/tmp/build_6e5670a3cba76a8761ecd1e7cf3f0284/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
remote:        added 210 packages from 130 contributors and audited 388 packages in 6.039s
remote:        found 1 low severity vulnerability
remote:          run `npm audit fix` to fix them, or `npm audit` for details
remote:
remote: -----> Caching build
remote:        - node_modules
remote:
remote: -----> Pruning devDependencies
remote:        audited 388 packages in 1.908s
remote:        found 1 low severity vulnerability
remote:          run `npm audit fix` to fix them, or `npm audit` for details
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 20.9M
remote: -----> Launching...
remote:        Released v3
remote:        https://shrouded-headland-66332.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/shrouded-headland-66332.git
 * [new branch]      master -> master
PS C:\Users\Administrator\Desktop\jd-interface> heroku open //檢查是否成功

  

三.微信小程序開發者註冊

https://developers.weixin.qq.com/miniprogram/dev/

參考官方開發文檔進行註冊操做建立

相關文章
相關標籤/搜索