mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:47:07 +00:00
Add /version/history endpoint to API.
Retrieves Git tag annotations.
This commit is contained in:
@@ -83,7 +83,10 @@ app.map({
|
||||
post: [ mw.user.logout ]
|
||||
},
|
||||
'/version': {
|
||||
get: [ mw.auth.operations, mw.version.get ]
|
||||
get: [ mw.auth.operations, mw.version.get ],
|
||||
'/history': {
|
||||
get: [ /*mw.auth.user,*/ mw.version.history.get ],
|
||||
}
|
||||
},
|
||||
'/': {
|
||||
get: [ mw.openapi.get ]
|
||||
|
||||
15
lib/www/server/api/middleware/version/history/get.js
Normal file
15
lib/www/server/api/middleware/version/history/get.js
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
const version = require('../../../../lib/version');
|
||||
|
||||
module.exports = async function (req, res, next) {
|
||||
|
||||
try {
|
||||
const v = await version.history(req.query.count, req.query.lines);
|
||||
res.status(200).json(v);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
return;
|
||||
}
|
||||
next();
|
||||
|
||||
};
|
||||
4
lib/www/server/api/middleware/version/history/index.js
Normal file
4
lib/www/server/api/middleware/version/history/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
module.exports = {
|
||||
get: require('./get'),
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
module.exports = {
|
||||
get: require('./get')
|
||||
get: require('./get'),
|
||||
history: require('./history'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user