1
0

Cleanup
All checks were successful
Android CI / build (push) Successful in 4m19s

This commit is contained in:
Natsu 2024-07-06 14:39:46 +07:00
parent 30d3d8c8af
commit 39c6e7419b
Signed by: NatsumeLS
GPG Key ID: 6DB67FB460CF46C6
5 changed files with 0 additions and 41 deletions

2
api/.gitignore vendored
View File

@ -1,2 +0,0 @@
node_modules
package-lock.json

View File

@ -1,32 +0,0 @@
// api/getLatestCommit.js
import fetch from 'node-fetch';
export default async (req, res) => {
const label = 'Latest Commit';
const username = 'NatsumeLS';
const repo = 'Gakumas-Localify-EN';
const apiUrl = `https://api.github.com/repos/${username}/${repo}/commits?per_page=1`;
try {
const response = await fetch(apiUrl);
const data = await response.json();
const latestCommitHash = data[0].sha.substring(0, 7);
res.setHeader('Content-Type', 'application/json');
res.setHeader('Cache-Control', 'no-cache');
res.status(200).json({
schemaVersion: 1,
label: label,
message: latestCommitHash,
color: 'blue'
});
} catch (error) {
res.status(500).json({
schemaVersion: 1,
label: label,
message: 'Error',
color: 'red'
});
}
};

View File

@ -1,7 +0,0 @@
{
"name": "api",
"type": "module",
"dependencies": {
"node-fetch": "^3.3.2"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB