cloud-git 开发一个git server 试用
cloud-git 是基于nodejs 开发的一个express git 中间件,可以用来开发git server,以下是一个简单的使用
git server
- package.json
{
"name": "mygit",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@fusebit/cloud-git": "^1.0.0",
"express": "^4.17.1"
},
"scripts": {
"start":"node app.js"
}
}
- app.js
const Express = require("express");
const { MemoryGitRepository } = require("@fusebit/cloud-git");
const app = Express();
app.use("/:repo", new MemoryGitRepository().createExpress(Express));
require("http").createServer(app).listen(3000);
- 启动
yarn start
使用
- 命令
mkdir test
cd test
git init
echo "Hello, world" > hello
git add .
git commit -am "init "
git remote add origin http://localhost:3000/dalong
git push origin master
- 效果
说明
cloud-git 为我们提供了一个框架,对于存储部分以及认证部分提供了扩展点,实际需要使用的话,需要我们自己解决,默认提供了基于内存的实现
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2020-10-06 drill http 存储插件试用
2020-10-06 apache drill 1.18.0 新特性
2020-10-06 drill 学习 十 drill rest api
2020-10-06 drill 学习 九 drill性能优化-整体介绍
2019-10-06 AsyncAPI 试用
2019-10-06 AsyncAPI and CloudEvents
2019-10-06 asyncapi 指南