Skip to content

Commit

Permalink
fix cms
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Sep 3, 2024
1 parent d4b14f4 commit 7148a60
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 30 deletions.
6 changes: 3 additions & 3 deletions cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
},
"dependencies": {
"@payloadcms/bundler-webpack": "^1.0.0",
"@payloadcms/db-mongodb": "^1.0.0",
"@payloadcms/plugin-cloud": "^3.0.0",
"@payloadcms/bundler-webpack": "^1.0.7",
"@payloadcms/db-mongodb": "^1.7.2",
"@payloadcms/plugin-cloud": "^3.0.2",
"@payloadcms/plugin-cloud-storage": "^1.1.3",
"@payloadcms/richtext-lexical": "^0.11.2",
"@payloadcms/richtext-slate": "^1.0.0",
Expand Down
5 changes: 5 additions & 0 deletions cms/src/collections/Posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ const Posts: CollectionConfig = {
hasMany: true,
required: true,
},
{
name: "email",
type: "text",
required: true,
},
{
name: "content",
type: "richText",
Expand Down
Binary file removed cms/src/media/Dragon-1.png
Binary file not shown.
Binary file removed cms/src/media/Dragon.png
Binary file not shown.
Binary file removed cms/src/media/download (2).png
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 12 additions & 12 deletions cms/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import express from 'express'
import payload from 'payload'
import express from "express";
import payload from "payload";

require('dotenv').config()
const app = express()
require("dotenv").config();
const app = express();

// Redirect root to Admin panel
app.get('/', (_, res) => {
res.redirect('/admin')
})
app.get("/", (_, res) => {
res.redirect("/admin");
});

const start = async () => {
// Initialize Payload
await payload.init({
secret: process.env.PAYLOAD_SECRET,
express: app,
onInit: async () => {
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
},
})
});

// Add your own express routes here

app.listen(3000)
}
app.listen(3000);
};

start()
start();
36 changes: 21 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7148a60

Please sign in to comment.