当前位置: 首页 > news >正文

哪家公司做网站不错关键词排名代发

哪家公司做网站不错,关键词排名代发,展示类网站cms,网站关键词下降一、项目背景 一份代码,发布多个小程序。想让技术支持部通过脚本自己获取代码,并通过脚本自动提交到客户的小程序后台。他们自行发布。 现已注册第三方平台,开发人员通过“开发小程序”上传模板。开发人员把代码上传到模板,支持…

一、项目背景

一份代码,发布多个小程序。想让技术支持部通过脚本自己获取代码,并通过脚本自动提交到客户的小程序后台。他们自行发布。

现已注册第三方平台,开发人员通过“开发小程序”上传模板。开发人员把代码上传到模板,支持人员选择模板进行发布小程序。好像git代码管理也不需要了。

二、主要代码

app.js

const express = require('express');
const fs = require('fs');
const simpleGit = require('simple-git');
const cors = require('cors'); // 引入 cors 模块const app = express();const gitUrl = 'xxx'; //配置
const branch = '5.0.1';
const codePath = 'unpackage/dist/build/mp-weixin';// 本地临时文件夹
const tempFolder = 'temp';// 使用 cors 中间件
app.use(cors());//clone项目
app.get('/api/gitClone', (req, res) => {simpleGit().clone(gitUrl, tempFolder, ['-b', branch], (err, data) => {if (err) {console.error('Clone failed:', err);} else {console.log('Clone success');res.json({message: 'clone成功'});// 2. 复制代码到指定路径// 这里可能需要根据你的实际需求使用适当的文件复制方法// 例如使用 fs-extra 库的 copy 方法// 3. 执行特定文件const filePath = `${tempFolder}/${codePath}/your-executable-file.js`;try {// execSync(`node ${filePath}`, {//     stdio: 'inherit'// });console.log('Execution success');} catch (error) {console.error('Execution failed:', error);}}});
});//git 获取所有分支
app.get('/api/gitBranches', (req, res) => {// 获取所有分支simpleGit(tempFolder).branch((err, branchSummary) => {console.log('branchSummary: ', branchSummary);if (err) {console.error('Error:', err);res.status(500).json({error: 'Failed to fetch branches'});} else {// 将分支信息转换为 JSON 格式并返回const branchesJson = {branches: branchSummary.all};// current: '5.0.1',  返回的字段为当前分支//{"branches":["5.0.1","remotes/origin/1.0.0","remotes/origin/2.0.0","remotes/origin/2.0.1","remotes/origin/2.0.2","remotes/origin/3.0.0","remotes/origin/4.0.0","remotes/origin/4.1.0","remotes/origin/4.2.0","remotes/origin/4.2.1","remotes/origin/5.0.1","remotes/origin/6.0.0","remotes/origin/master"]}res.json(branchesJson);}});
});//git 切换分支
app.get('/api/checkoutBranch', (req, res) => {// 获取所有分支simpleGit(tempFolder).checkout('6.0.0', (err) => {if (err) {console.error('Error:', err);} else {console.log('Switched to branch 6.0.0');res.json({message: '切换成功'});}});
});const branchToPull = '6.0.0'; // 要拉取的分支名称//git 拉取指定分支代码
app.get('/api/pull', (req, res) => {// 获取所有分支// 拉取分支代码simpleGit(tempFolder).pull('origin', branchToPull, (err, update) => {if (err) {console.error('Error:', err);res.json({message: '拉取错误'});} else if (update && update.summary.changes) {console.log(`Pulled ${update.summary.changes} changes from branch ${branchToPull}`);res.json({message: '最新成功'});} else {console.log('Already up to date');res.json({message: '已经是最新'});}});
});app.listen(8000, () => {console.log(`Server is running on port 8000`);
});
http://www.ritt.cn/news/27996.html

相关文章:

  • 夷陵网武汉seo排名公司
  • 装修公司怎么做网站推广线上招生引流推广方法
  • 网站建设需要注意事项百度搜索电话
  • 微信公众平台开发工具优化网站seo策略
  • 烟台网站制作哪家好国内网站建设公司
  • 网站文章正文可以做内链吗百度学术论文查重
  • 婚庆网站名字成都百度推广和seo优化
  • 盐步网站制作网站收录查询平台
  • 手机电脑同步网站开发广告联盟app推广
  • 杭州设计制作网站短期培训学什么好
  • 创建网站需要多少钱百度广告推广收费标准
  • 个体可以做企业网站吗关键词全网搜索指数
  • 建立微信商城网站seo平台代理
  • wordpress换服务器郑州seo外包v1
  • 网站制作能在家做吗推广app赚钱
  • 如何用华为云服务器做网站seo什么意思
  • 青岛公司网站建设价格免费网络推广渠道
  • 宁波优化网站厂家国外媒体报道
  • 各类郑州网站建设网店网络推广方案
  • wordpress插件汉化下载地址开鲁网站seo
  • web电子商务网站网站快速刷排名工具
  • 微信电影网站怎么做的深圳市网络品牌推广
  • 效果好企业营销型网站建设开发网站安全检测平台
  • 河北 网站建设seo知识培训
  • 垫江网站建设网络营销企业有哪些
  • wordpress theme cmsseo 网站推广
  • 营销型网站典型多地优化完善疫情防控措施
  • 本地数据库搭建网站抖音关键词排名优化软件
  • 企业seo平台优化推广排名网站教程
  • 网站建设如果没有源代码建立一个网站需要花多少钱