Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit bde4264d by Jean-Marc Le Roux

Merge remote-tracking branch 'parlement-ouvert/master'

parents 1efa994b c7cba927
Pipeline #27463 passed with stages
in 1 minute 56 seconds
const app = require('express')();
const bodyParser = require('body-parser');
const proxy = require('express-http-proxy');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
......@@ -19,6 +20,43 @@ app.use(bodyParser.json());
*/
app.use('/api/v1/ping', require('./ping'));
/**
* @api {get} /api/v1/project/:project_id/articles List articles
* @apiVersion 1.0.0
* @apiDescription Implement the GET /project/:project_id/articles API endpoint
* @apiName List articles
* @apiGroup Utils
*
* @apiSuccess {String} id ID of the file
* @apiSuccess {String} name Name of the file
* @apiSuccess {String} type Type of the file
* @apiSuccess {String} path Path of the file
* @apiSuccess {String} mode Mode of the file
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* [
* {
* "id": "fc798eff13af1df4a91dc14d26b22c95a90e717d",
* "name": "Article_1.md",
* "type": "blob",
* "path": "Article_1.md",
* "mode": "100644"
* }
* ]
*/
app.get('/api/v1/project/:project_id/articles', proxy('localhost:8000', {
proxyReqPathResolver: (req) => {
return '/admin/api/v4/projects/' + req.params.project_id + '/repository/tree'
},
userResDecorator: (proxyRes, proxyResData, userRaq, userReq) => {
var data = JSON.parse(proxyResData.toString('utf8'));
data = data.filter((e) => e.name.endsWith('.md'));
return JSON.stringify(data);
}
}));
app.listen(3001, () => {
console.log('API server listening on port 3001')
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment