kios-webapp/payload/src/server.ts
Max Schmidt b958e29288 asdf
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
2023-05-19 07:37:21 +02:00

22 lines
461 B
TypeScript

import express from "express";
import payload from "payload";
require("dotenv").config();
const app = express();
app.get("/", (_, res) => {
res.redirect("/admin");
});
payload.init({
secret: process.env.PAYLOAD_SECRET,
mongoURL: process.env.MONGODB_URI,
express: app,
onInit: () => {
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
},
});
app.use("/media", express.static("media"));
app.listen(process.env.PAYLOAD_PORT);