Closed Denis-Zhukov closed 1 year ago
Use without endpoint:
app.use((req, res) => {
repos.handle(req, res);
})
git push http://localhost:8000/somebody/beep master
It works. But... 2 folders are created. One is empty. And the global endpoint is not very suitable
Also I try use this endpoint:
app.use("/git/:repo", (req, res) => {
repos.handle(req, res);
})
git push http://localhost:8000/git/somebody/beep master
User folder not created =(
Some one? =(
Some one? =(
Use translator from Russian to English if you need.
Данный странный эффект проявляется из-за использования url.parse(req.url)
в исходных кодах библиотеки, который объявлен Deprecated в документации nodejs: по каким-то причинам данная функция превращает путь /git/beep/info/refs?service=git-receive-pack
в /beep/info/refs?service=git-receive-pack
, т. е. урезая первую часть. В причины я уже не стал углубляться, но решение может быть таким (если не менять исходные коды самой библиотеки):
app.use("/:account/:repo", (req, res) => {
req.url = req.originalUrl;
repos.handle(req, res);
});
Спасибо, это помогло =)
Hello. How to collect repositories by user folders? I use node-git-server and express together. Code:
It doesn't work. The request comes and goes to handle, but something goes wrong there?
It works:
But it without account name and url has superfluous endpoint "/git" I will add the user to the path without changing the endpoint
It works! But "/git" need it. Lets try delete it.
Now repo inside repos, not inside the user folder. It's bad (
Lets try change endpoint:
It does't work (
It doens't work too:
Help me please. I want to make a git server where the user will be. And user repositories should be in folders with their names.