Nodejs server API that show git log from one folder
git clone https://github.com/maximilianoh/NodeGitLog.git
yarn install
yarn start
In configServerGit.json
{
"path": "path/local/repository/.git",
"notCheckUpdate": true,
"branch": "master"
}
notCheckUpdate = true if it do git pull in all petitions,
false you can update manually with url: /updateRepository
branch do git pull origin "branch"
In index.js
You can change the port
git clone https://github.com/octocat/Spoon-Knife.git in /home/user/example/
set /home/user/example/Spoon-Knife/.git in configServerGit.json
Update Repository (GET)
http://localhost:3001/updateRepository
Show commits (POST)
http://localhost:3001/commits
{"cantHistorys":""} or {}
{"cantHistorys":"5"} or {"cantHistorys":5}
Show commits by file (POST)
http://localhost:3001/commitsFile
{"cantHistorys":"", "file":""} or {}
{"cantHistorys":"", "file":"readme"}
check if readme has changed in last "cantHistorys" commits
Show commits by author (POST)
http://localhost:3001/commitsAuthor
{"cantHistorys":"", "author":""} or {}
{"cantHistorys":"1", "author":"oct"}
check if "author" has commited in last "cantHistorys" commits
200:
[
{
"commit": "f439fc5710cd87a4025247e8f75901cdadf5333d",
"author": "The Octocat <[email protected]>",
"date": "Wed Sep 3 14:22:02 2014 -0700",
"message": "Update README.md",
"files": [
"README.md"
]
}
]
404:
{
"error": "Something wrong, please check your configServerGit.json or if your project has at least one commit"
}