add prototypes of api routes
This commit is contained in:
parent
444ed847cd
commit
485017b916
20
src/main.js
20
src/main.js
@ -1,6 +1,7 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import bodyParser from "body-parser";
|
import bodyParser from "body-parser";
|
||||||
import cookieParser from "cookie-parser";
|
import cookieParser from "cookie-parser";
|
||||||
|
import cors from "cors";
|
||||||
import morgan from "morgan";
|
import morgan from "morgan";
|
||||||
|
|
||||||
import LDAP from "./ldap.js";
|
import LDAP from "./ldap.js";
|
||||||
@ -22,3 +23,22 @@ global.package = _package(global.argv.package);
|
|||||||
global.config = _config(global.argv.configPath);
|
global.config = _config(global.argv.configPath);
|
||||||
|
|
||||||
const ldap = new LDAP(global.argv.ldapURL, global.config.basedn);
|
const ldap = new LDAP(global.argv.ldapURL, global.config.basedn);
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
app.use(cookieParser());
|
||||||
|
app.use(cors({ origin: global.db.hostname }));
|
||||||
|
app.use(morgan("combined"));
|
||||||
|
|
||||||
|
// endpoint handles both adding a new user and updating an existing user including password and groups
|
||||||
|
app.post("/users/:userid", (req, res) => {});
|
||||||
|
|
||||||
|
app.get("/users/:userid", (req, res) => {});
|
||||||
|
|
||||||
|
app.delete("/users/:userid", (req, res) => {});
|
||||||
|
|
||||||
|
app.post("/groups/:groupid", (req, res) => {});
|
||||||
|
|
||||||
|
app.get("/groups/:groupid", (req, res) => {});
|
||||||
|
|
||||||
|
app.delete("/groups/:groupid", (req, res) => {});
|
Loading…
Reference in New Issue
Block a user