You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
It works perfectly when I am trying the example code you are providing:
var express = require("express");
var expressGit = require("express-git");
var app = express();
app.use("/git", expressGit.serve("path/torepos/", {
auto_init: true,
serve_static: true,
authorize: function (service, req, next) {
// Authorize a service
next();
}
});
app.on('post-receive', function (repo, changes) {
// Do something after a push
next();
});
app.listen(3000);
But I have two problems:
First, it looks like there is a missing closing parenthesis in the example code (before the semicolon on line 11).
Second, the post-receive hook seems to not working. The git push works successfully but the app.on('post-receive',... is never called when the push is completed. Is it right?
I saw a closed issue (#2) related to this second problem. I am using express-git 0.7.0, but the expressGit.on() is not recognized (message: expressGit.on is not a function)
Even if am a software developper for years, I am a newbie in using node.js. Maybe I misunderstood something?