summaryrefslogtreecommitdiff
path: root/src/api/endpoints/meta.js
blob: 7938cb91b4221a3042a918468c2504a929d2c53d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';

/**
 * Module dependencies
 */
import Git from 'nodegit';

/**
 * Show core info
 *
 * @param {Object} params
 * @return {Promise<object>}
 */
module.exports = (params) =>
	new Promise(async (res, rej) =>
{
	const repository = await Git.Repository.open(__dirname + '/../../');

	res({
		maintainer: config.maintainer,
		commit: (await repository.getHeadCommit()).sha(),
		secure: config.https.enable
	});
});