From a32149551923097290f2f958b8ded8a5c2e25d7d Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Wed, 5 Mar 2025 21:57:48 +0100 Subject: [PATCH] add condastatus --- routes/shared.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/routes/shared.js b/routes/shared.js index 1f545d5..ec68e32 100644 --- a/routes/shared.js +++ b/routes/shared.js @@ -74,6 +74,19 @@ router.get('/shared/cranstatus/:package', function(req, res, next) { }); }); +router.get('/shared/condastatus/:package', function(req, res, next) { + return fetch(`https://api.anaconda.org/package/conda-forge/r-${req.params.package}`).then(function(response){ + if (!response.ok) { + throw "Failed to find package metadata on conda-forge"; + } + return response.json().then(function(conda){ + return res.set('Cache-Control', 'max-age=3600, public').send({ + name: conda.full_name, url: conda.html_url, version: conda.latest_version + }); + }); + }); +}); + router.get('/shared/webrstatus', function(req, res, next) { const promise = new session.Shelter(); return promise.then(function(shelter){