From 2ceb6e8c986f7e77f0d74aaac065fc969d39fc3e Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 21 Jun 2021 14:12:05 +0200 Subject: Added branch & tag API endpoints, tag tarball downloading and added handlers to the api --- packages/server/src/app.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/server/src/app.ts') diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index d5f63b0..263703b 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -117,6 +117,15 @@ fastify.route({ } }); +fastify.route({ + method: "GET", + url: "/:repo([a-zA-Z0-9\\.\\-_]+)/refs/tags/:tag", + handler: (req, reply) => { + const params: any = req.params; + git.downloadTagArchive(params.repo, params.tag, reply); + } +}); + fastify.listen(settings.port, settings.host, (err: Error, addr: string) => { if(err) { console.error(err); -- cgit v1.2.3-18-g5258