diff --git a/server/express/api/index.ts b/server/express/api/index.ts index de9f23d..65a723a 100644 --- a/server/express/api/index.ts +++ b/server/express/api/index.ts @@ -5,6 +5,7 @@ import { ErrorCode } from "@common/ErrorCode"; import { authentication } from "@server/express/authentication"; import { ServerState } from "@server/state"; import { devices } from "./devices"; +import { mosquitto } from "./mosquitto"; import { users } from "./users"; export default function createApi(state: ServerState) { @@ -12,6 +13,7 @@ export default function createApi(state: ServerState) { router.use("/devices", devices(state)); router.use("/users", users(state)); + router.use("/mosquitto", mosquitto(state)); router.use("/token", authentication(state)); router.use("*", (req, res) => { diff --git a/server/express/api/mosquitto.ts b/server/express/api/mosquitto.ts new file mode 100644 index 0000000..41f7113 --- /dev/null +++ b/server/express/api/mosquitto.ts @@ -0,0 +1,21 @@ +import PromiseRouter from "express-promise-router"; + +import { ServerState } from "@server/state"; + +export function mosquitto(state: ServerState) { + const router = PromiseRouter(); + + router.post("/auth", async (req, res) => { + res.status(200).send(); + }); + + router.post("/superuser", async (req, res) => { + res.status(200).send(); + }); + + router.post("/acl", async (req, res) => { + res.status(200).send(); + }); + + return router; +} \ No newline at end of file diff --git a/server/express/index.ts b/server/express/index.ts index 9d2e4fc..8e0df2f 100644 --- a/server/express/index.ts +++ b/server/express/index.ts @@ -12,6 +12,7 @@ export function createApp(state: ServerState) { app.use(requestLogger); app.use(bodyParser.json()); + app.use(bodyParser.urlencoded({ extended: true })); app.use("/api", createApi(state));