apxtrib/api/routes/wwws.js

20 lines
788 B
JavaScript
Raw Normal View History

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-12-05 06:42:35 +00:00
// GET api/wwws/conf/:tribeId/:website
// if profils accessright return the nginx conf in ${conf.dirtown}/tribes/${req.param.tribeId}/www/nginx_${req.params.tribeId}_${req.params.website}.conf
router.get("/conf/:tribeId/:website", checkHeaders, isAuthenticated, (req, res) => {
2023-05-12 05:59:32 +00:00
res.send(Www.configlist(req.params.tribeId));
});
2023-12-05 06:42:35 +00:00
router.post("/conf/:tribeId/:website", checkHeaders, isAuthenticated, (req, res) => {
2023-05-12 05:59:32 +00:00
res.send(Wwws.create(req.params.tribeId));
});
module.exports = router;