From 414cc5c2a86d3796850e5c924a2da462e5f0aba2 Mon Sep 17 00:00:00 2001 From: Tosuke Date: Fri, 6 Jan 2017 20:20:23 +0900 Subject: [PATCH 1/2] Add ignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1f5bd6967..51f1480de 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log *.pem run.bat +api-docs.json From 2a383e8d53c64a80c3355f1d15f8c7a90cdac70d Mon Sep 17 00:00:00 2001 From: Tosuke Date: Fri, 6 Jan 2017 22:03:12 +0900 Subject: [PATCH 2/2] [API]Fix /meta --- src/api/endpoints/meta.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/endpoints/meta.js b/src/api/endpoints/meta.js index 7938cb91b..acbe43a54 100644 --- a/src/api/endpoints/meta.js +++ b/src/api/endpoints/meta.js @@ -3,7 +3,8 @@ /** * Module dependencies */ -import Git from 'nodegit'; +import prominence from 'prominence'; +import git from 'git-last-commit'; /** * Show core info @@ -14,11 +15,11 @@ import Git from 'nodegit'; module.exports = (params) => new Promise(async (res, rej) => { - const repository = await Git.Repository.open(__dirname + '/../../'); + const commit = await prominence(git).getLastCommit(); res({ maintainer: config.maintainer, - commit: (await repository.getHeadCommit()).sha(), + commit: commit.shortHash, secure: config.https.enable }); });