1
0
forked from apxtri/apxtri
apxtri/routes/wwws.js

20 lines
788 B
JavaScript
Raw Normal View History

2023-12-07 12:04:19 +01: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");
const router = express.Router();
// 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) => {
res.send(Www.configlist(req.params.tribeId));
});
router.post("/conf/:tribeId/:website", checkHeaders, isAuthenticated, (req, res) => {
res.send(Wwws.create(req.params.tribeId));
});
module.exports = router;