Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt
2023-05-17 11:56:36 +02:00
parent 7f01d39909
commit d30d3e61b9
16 changed files with 133 additions and 54 deletions

View File

@ -4,12 +4,10 @@ import payload from "payload";
require("dotenv").config();
const app = express();
// Redirect root to Admin panel
app.get("/", (_, res) => {
res.redirect("/admin");
});
// Initialize Payload
payload.init({
secret: process.env.PAYLOAD_SECRET,
mongoURL: process.env.MONGODB_URI,
@ -18,7 +16,4 @@ payload.init({
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
},
});
// Add your own express routes here
app.listen(process.env.PAYLOAD_PORT);