1.安装git

  1. yum install git
  2. git --version //可以查看是否安装成功

image.png

2.配置用户名和邮箱

  1. git config --global user.name "chengbenchao"
  2. git config --global user.email "xx"
  3. git config --global --list

image.png

3.在吗云中新建仓库

  1. 复制仓库 网站然后再 git clone 到自己的文件夹
  2. $ git clone https://gitee.com/squirrel-acc-mandarin-fish/double.git

image.png

4.在文件夹中写node

image.png

  1. .gitignore 中写不上传的文件
  1. index.js
  2. const koa = require("koa");
  3. const app = new koa();
  4. const router = require("koa-router")();
  5. router.get("/",async ctx=>{
  6. ctx.body="hello world"
  7. })
  8. app.use(router.routes());
  9. app.listen(8080)
  10. //本地接口

5.将马云推送

image.png
image.png
推送成功

6.进入home新建文件夹mayun

image.png

  1. $ git clone https://gitee.com/squirrel-acc-mandarin-fish/double.git
  2. 进入double
  3. 输入yarn
  4. 就可以将所有依赖安装

image.png
image.png

7.将接口放到公网

打开8080端口

02.png

image.png
04.png