2023-05-12 05:59:32 +00:00
|
|
|
const express = require("express");
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
// Classes
|
|
|
|
const Wwws = require("../models/Wwws.js");
|
|
|
|
// Middlewares
|
|
|
|
const checkHeaders = require("../middlewares/checkHeaders");
|
|
|
|
const isAuthenticated = require("../middlewares/isAuthenticated");
|
2023-11-05 11:03:25 +00:00
|
|
|
|
2023-05-12 05:59:32 +00:00
|
|
|
const router = express.Router();
|
2023-11-19 15:34:37 +00:00
|
|
|
|
2023-05-12 05:59:32 +00:00
|
|
|
/**
|
|
|
|
* To manage an nginx conf
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
router.get("/tribes/:tribeId", checkHeaders, isAuthenticated, (req, res) => {
|
|
|
|
/**
|
|
|
|
* @api {get} /www/tribes/:tribeId
|
|
|
|
* @apiName Get list of application Name
|
|
|
|
* @apiGroup Www
|
|
|
|
*
|
|
|
|
* @apiUse apxHeader
|
|
|
|
*
|
|
|
|
* @apiParam {String} tribeId Mandatory that have to exist in current town and
|
|
|
|
*
|
|
|
|
* @apiError (404) {string} status the folder does not exist
|
|
|
|
* @apiError (404) {string} ref objectmodel to get in the right language
|
|
|
|
* @apiError (404) {string} msg key to get template from objectmodel
|
|
|
|
* @apiError (404) {object} data use to www's model: 'Www' } );render lg/objectmodel_lg.json
|
|
|
|
*
|
|
|
|
* @apiSuccess (200) {object} data contains liste of www conf of a tribe
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
res.send(Www.configlist(req.params.tribeId));
|
|
|
|
});
|
|
|
|
router.post("/:webappname", checkHeaders, isAuthenticated, (req, res) => {
|
|
|
|
/**
|
|
|
|
* Create a space web /tribes/www/webappname
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* */
|
|
|
|
res.send(Wwws.create(req.params.tribeId));
|
|
|
|
});
|
|
|
|
module.exports = router;
|